php中如何指定位置替换-PHP问题

资源魔 26 0

php中若何指定地位交换?

应用substr_replace() 函数

界说以及用法
substr_replace() 函数把字符串的一局部交换为另外一个字符串。

语法
substr_replace(string,replacement,start,length)

<?php教程
echo substr_replace("hello world","earth",6);
?>

string 必须。规则要反省的字符串

replacement 必须。规则要拔出的字符串。

start 必须。规则正在字符串的那边开端交换

可选。规则要交换几何个字符。

保举教程: 《php教程》

以上就是php中若何指定地位交换的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 php故障解决 php使用问题

抱歉,评论功能暂时关闭!