PHP编程:php字符串替换函数substr_replace()用法实例
发布时间:2020-12-13 02:29:20 所属栏目:PHP教程 来源:网络整理
导读:《php字符串替换函数substr_replace()用法实例》要点: 本文介绍了php字符串替换函数substr_replace()用法实例,希望对您有用。如果有疑问,可以联系我们。 本篇章节讲解php字符串替换函数substr_replace()用法.供大家参考研究.具体分析如下: PHP实
《php字符串替换函数substr_replace()用法实例》要点: 本篇章节讲解php字符串替换函数substr_replace()用法.分享给大家供大家参考.具体分析如下:PHP实例 substr_replace用于在指定字符串中替换指定位置的子字符串PHP实例 <?php $string = "Warning: System will shutdown in NN minutes!"; $pos = strpos($string,"NN"); print(substr_replace($string,"15",$pos,2)."n"); sleep(10*60); print(substr_replace($string,"5",2)."n"); ?> 上面代码输入如下结果PHP实例 Warning: System will shutdown in 15 minutes! (10 minutes later) Warning: System will shutdown in 5 minutes! 希望本文所述对大家的php程序设计有所赞助.PHP实例 《php字符串替换函数substr_replace()用法实例》是否对您有启发,欢迎查看更多与《php字符串替换函数substr_replace()用法实例》相关教程,学精学透。编程之家 52php.cn为您提供精彩教程。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |