I have a variable $object like this :
$object = ['Apple-2','Apolo-23','Nine-99','Ex-0'];
How do to make each value in $object to array. I want output like this:
Array
(
[0] => Apple-2,
[1] => Apolo-23,
[2] => Nine-99,
[3] => Ex-0
)
I have a variable $object like this :
$object = ['Apple-2','Apolo-23','Nine-99','Ex-0'];
How do to make each value in $object to array. I want output like this:
Array
(
[0] => Apple-2,
[1] => Apolo-23,
[2] => Nine-99,
[3] => Ex-0
)
$object is already an array.
You just need to print it.
echo '<pre>';
print_r($object);
echo '</pre>';
Output :
if need comma after each value, add below line before print:
array_walk($object, function(&$object) {
$object = $object . ",";
return $object;
});