substr_replace

substr_replacesubstr_replace() 函式把字元串的一部分替换为另一个字元串 。
基本介绍中文名:substr_replace
字元串:string
字元:replacement
参数:start
语法substr_replace(string,replacement,start,length)参数描述string必需 。规定要检查的字元串 。replacement必需 。规定要插入的字元串 。start必需 。规定在字元串的何处开始替换 。正数 - 在第 start 个偏移量开始替换负数 - 在从字元串结尾的第 start 个偏移量开始替换0 - 在字元串中的第一个字元处开始替换charlist可选 。规定要替换多少个字元 。正数 - 被替换的字元串长度负数 - 从字元串末端开始的被替换字元数0 - 插入而非替换提示和注释注释:如果 start 是负数且 length 小于等于 start,则 length 为 0 。例子<?phpecho substr_replace("Helloworld","earth",6);?>输出:【substr_replace】HellowearthPHP String 函式