替换指定字符串中,键对应的键值
<?php $arr=array('a'=>'aaaa','b'=>'bbbb','c'=>'cccc','d'=>'dddd','e'=>'eeeee',); $content=str_replace(array_keys($arr),array_values($arr),'hello a'); echo $content;
结果:
赞赏码
![](https://files.cnblogs.com/files/lxwphp/zhifubao2.bmp)
![](https://files.cnblogs.com/files/lxwphp/weixin.bmp)
非学,无以致疑;非问,无以广识
<?php $arr=array('a'=>'aaaa','b'=>'bbbb','c'=>'cccc','d'=>'dddd','e'=>'eeeee',); $content=str_replace(array_keys($arr),array_values($arr),'hello a'); echo $content;
结果:
赞赏码
非学,无以致疑;非问,无以广识