I have to split strings of the type:
$str1 =' Large ladies hats 1.365 0.334';
$str2 = 'Pins 0.335 0.22';
into separate variables (or array members) :
say, $textStr, $number1, $number2 or $pieces[0] $pieces[1] $pieces[2]
for inclusion in 3 separate fields of a database row
I am new to the world of regex and split() or preg_split() etc. and have
been trying all day to do this seemingly
simple task but keep running into problems till my head spins.
Can anyone give me some pointers?
(I have tried the manuals!)
$str1 =' Large ladies hats 1.365 0.334';
$str2 = 'Pins 0.335 0.22';
into separate variables (or array members) :
say, $textStr, $number1, $number2 or $pieces[0] $pieces[1] $pieces[2]
for inclusion in 3 separate fields of a database row
I am new to the world of regex and split() or preg_split() etc. and have
been trying all day to do this seemingly
simple task but keep running into problems till my head spins.
Can anyone give me some pointers?
(I have tried the manuals!)
Comment