Home >Backend Development >PHP Problem >How to convert php string to array

How to convert php string to array

藏色散人
藏色散人Original
2020-11-03 11:28:302502browse

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.

How to convert php string to array

Recommended: "PHP Video Tutorial"

The code is as follows:

How to convert php string to array

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn