Forum Moderators: coopster
i've got a variable with a load of numbers in it, seperated by commas.
eg.
$posts = "555,666,777,888,999";
and i am trying to put those numbers inside an array
eg.
array($posts)
but it only ever takes notice of the first number (555). but when i do it like this instead,
array(555,666,777,888,999)
then it works fine
i can't see how how swapping the numbers for the variable would make a difference?
when i do print_r on array($posts), i get this
array([0] => 1074,1139,1076,1494,1078)
when i really want it to say this
array(1074,1139,1076,1494,1078)
anyone know where i'm going wrong?
explode [uk.php.net] will do the job of turning the string into an array