hunter hunter - 1 year ago 47
PHP Question

how to convert a string to an array in php

how to convert a string in array in php i.e

 $str="this is string";


should be like this

 arr[0]=this
arr[1]=is
arr[2]=string


The
str_split($str, 3);
split the string in 3 character word but i want to convert the string after whitespace in an array.

Answer Source
$array = explode(' ', $string);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download