KANAYO AUSTIN KANE KANAYO AUSTIN KANE - 3 months ago 10
PHP Question

Creating a Php array from an exploded string

I have a string.

$string = "this is my string";


So I want to explode it.

$explode = explode(' ', $string);


Now I want to know if it's possible to insert each word into an array so I can get this.

$array = array('this', 'is', 'my', 'string');

Answer

Just like Frayne Konok said, the $explode is the array similar to $array. The explode function already did it.