您好,欢迎访问一九零五行业门户网

PHP字符串替换函数 可同时替换多个关键词

$strseg){ $x=$i+1; if($index==(count($strsegarray)-1)) $result=$result.replace($strseg,$keyarray,$replacement,$x); else $result=$result.replace($strseg,$keyarray,$replacement,$x).$replacement[$i]; } return $result; } else{ return $string; } }
复制代码
代码说明:$string=' 键名 数组可以同时含有 integer 和 string 类型的键名,12345678 因为 php 实际并不区分索引数组和关联数组。如果对给出的值没有指定键名,则取当前最大的整数索引值,而新的键名将是该值加一。如果指定的键名已经有了值,则该值会被覆盖。';示例:
$keyarray=array('数组','integer','2345','键名'); $replacement=array('aaaa','bbbb','cccc','dddd');echo replace($string,$keyarray,$replacement,0);
复制代码
其它类似信息

推荐信息