okay, here it is, simple
$arrvalue = "1,2,3,4,5"; $array = array($arrvalue); print_r($array);
outputs
Array ( [0] => 1,2,3,4,5 )
how can i get the output to be
Array ( [0] => 1, [1] => 2, [2] => 3, [3] => 4, [4] => 5 )
Do an [man]explode/man on the commas.
please explain, wont that just give me
Array ([0] => 1 2 3 4 5)
without the commas then?
my goal is to make each number (1, 2,3, 4, 5) as a different array value
Read the manual page for [man]explode[/man]. Then try it out.
explode
or
$x = preg_split(/,/,$string,-1,PREG_SPLIT_NO_EMPTY); print_r($x);
Yeah, sorry guys, guess its a case of RTFM... i got it now, and thanks for not laughing too hard at me