How to convert string into array in php

王林
Release: 2023-03-01 09:02:02
Original
3906 people have browsed it

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);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!