Home > Backend Development > PHP Tutorial > Two ways to split strings word by word in PHP_PHP tutorial

Two ways to split strings word by word in PHP_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:26:46
Original
1378 people have browsed it

Method one:

Note: 1. The $charset variable is the web page encoding, such as "gb2312" or "utf-8";

2. The first method requires that the server must enable the mbstring.dll extension, otherwise the code will execute incorrectly, so for those who use virtual hosts, you can consider using the second method. ​

Method 2: 127?$str[$i].$str[++$i]:$str[$i]; } return $arr; } $arr=str_to_arr($str); ? >

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/822516.htmlTechArticleMethod 1: ?php $str=Web page: http://www.wangyeba.com; functionmbstringtoarray($ str,$charset){ $strlen=mb_strlen($str); while($strlen){ $array[]=mb_substr($str,0,1,$charset);...
Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template