Blogger Information
Blog 26
fans 0
comment 0
visits 19582
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
4.18数组及字符串的操作
十一
Original
759 people have browsed it

实例

<?php 
echo '<p>长度计算</p><hr color="green">';
$title = 'php中文网';
//获取字节字符串长度
echo strlen($title),'<br>';
//获取字符串长度
echo mb_strlen($title),'<br>';

echo '<p>字符串与数组之间转换</p><hr color="green">';
echo '<pre>';
$attr = 'html,css,jquery,php,mysql,thinkphp';
//1.str_split($str,$length=1)按字符数量,将字符串分割为数组,默认为1
print_r(str_split($attr)); //默认一个字符转为数组中的一个元素
print_r(str_split($attr,5)); //5个一组进行转换

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post