Blogger Information
Blog 60
fans 1
comment 1
visits 63677
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php中实例演示substr(),strstr(),strpos()函数_2018年8月27日
PHP学习
Original
959 people have browsed it

实例


       

运行实例 »

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

substr(变量,开始位置,长度)里面有三个参数

实例


       

运行实例 »

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

如果后面的长度为负数就从尾部开始算起来切取。


实例


       

运行实例 »

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

strstr(变量,关键字,true);这个是从关键字处开始截取,如果是为false往后面,如果为true就是往前面,以关键字为定位。

实例

 0) { echo $arr2; }else{ echo 'false'; }

运行实例 »

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

strpos(变量1,变量2)判断变量1中多少个字符开始出现变量2里面的一个字符串。

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 withNews Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!