Home >Backend Development >PHP Problem >How to convert php string to array
How to convert string to array in php: first define a string; then convert the string into an array through the explode function; and finally print out the scattered string.
Recommended: "PHP Video Tutorial"
The code is as follows:
explode() function breaks up the string into an array.
Note: The "separator" parameter cannot be an empty string.
Note: This function is binary safe.
Grammar
explode(separator,string,limit)
The above is the detailed content of How to convert php string to array. For more information, please follow other related articles on the PHP Chinese website!