I have this variable $numbers and it contains values like this way-> 1,2,3,4,5
So when I echo this $number I naturally see like this-> 1,2,3,4,5
Now, Could you please tell me how to convert the variable “$number” like following
$topic=array("1","2","3","4","5");
You can just use
explodewhich splits a string on a delimiter and returns an array. You don’t need to add quotes around the numbers.