php convert string to array code example
Example 1: explode comma php
$myString = "9,[email protected],8";
$myArray = explode(',', $myString);
print_r($myArray);
Example 2: php stdclass to array
// The manual specifies the second argument of json_decode as:
// assoc
// When TRUE, returned objects will be converted into associative arrays.
$array = json_decode(json_encode($booking), true);
Example 3: string to array in php
print_r(explode(',',$yourstring));
Example 4: php split string
explode(" ","Geeks for Geeks")