The content of this article is to share with you PHP string to array and array to string. Friends in need can refer to it
//数组按指定方式分割为字符串 $arr = array('Hello','World!','I','love','Shanghai!'); echo implode(" ",$arr); //字符串按指定规则合并为数组 $string = "Hello World love Shanghai"; $arr = explode(" ", $pizza); print_r($arr);
Related recommendations:
php character encoding conversion
Detailed explanation of the difference between three PHP string delimiters
php string usage Detailed explanation
The above is the detailed content of PHP string to array and array to string. For more information, please follow other related articles on the PHP Chinese website!