Home >Backend Development >PHP Problem >How to convert string into array in php
Implementation idea:
First split the string into single characters and store them in an array, and then print the array.
The specific code is as follows:
$m='woxihuanphp'; echo $res=trim(chunk_split($m,1,'.'),'.'); $arr1=explode('.',$res); var_dump($arr1);
For more related tutorials, please visit php Chinese website.
The above is the detailed content of How to convert string into array in php. For more information, please follow other related articles on the PHP Chinese website!