php substr cnblog,php中substr用法示例
发布日期:2021-06-24 13:24:41 浏览次数:4 分类:技术文章

本文共 706 字,大约阅读时间需要 2 分钟。

位置为正值echo substr("Hello world",0,10)."\r\n";

echo substr("Hello world",1,8)."\r\n";

echo substr("Hello world",0,5)."\r\n";

echo substr("Hello world",6,6)."\r\n";

echo "-------------------------\r\n";

echo substr("Hello world",10)."\r\n";

echo substr("Hello world",1)."\r\n";

echo substr("Hello world",3)."\r\n";

echo substr("Hello world",7)."\r\n";

位置为负值echo substr("Hello world",0,-1)."\r\n";

echo substr("Hello world",-10,-2)."\r\n";

echo substr("Hello world",0,-6)."\r\n";

echo substr("Hello world",-2-3)."\r\n";

echo "-------------------------\r\n";

echo substr("Hello world",-1)."\r\n";

echo substr("Hello world",-10)."\r\n";

echo substr("Hello world",-8)."\r\n";

echo substr("Hello world",-4)."\r\n";

转载地址:https://blog.csdn.net/weixin_33137081/article/details/115946513 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:php链接怎么截取,PHP 截取网页中的固定种子链接
下一篇:Mysql从库主键卡住,数据库主键更新死锁问题

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年03月30日 02时12分25秒