How to create array from string in PHP

1 Answer

0 votes
$s = "php python c c++ java";
$arr = explode(" ", $s);
print_r($arr);


/*
run:
 
Array ( [0] => php [1] => python [2] => c [3] => c++ [4] => java )
    
*/

 



answered Sep 8, 2018 by avibootz
...