PDA

View Full Version : convert string to array?


bsxiong
05-30-2008, 01:00 PM
i've been trying to convert this string to an array, but for some reasons i don't know, it's not happening.

$string = "02 03 04 05 06 07";

echo explode($string);// should display "array"

print_r(explode($string));// should return all the array


any help on converting that string to an array?

Vege
05-30-2008, 01:11 PM
$string = "02 03 04 05 06 07";

$r = explode(" ",$string);

print_r($r);

Is this what your trying to do?

bsxiong
05-30-2008, 01:14 PM
ahhh yes! once again, blinded by overlooking how the function works.

thanks vege

erisco
05-31-2008, 08:00 AM
Try http://php.net/explode next time.