Home >Backend Development >PHP Tutorial >替换多个字符串解决方案

替换多个字符串解决方案

WBOY
WBOYOriginal
2016-06-13 10:22:16995browse

替换多个字符串
我想把一个字符串中的多个字符给替换了,比如字符串"11,22,33,44",我想替换成"一,二,三,四",字符串的长度不固定, 内容也不固定,请问我该怎么写,谢谢大家

------解决方案--------------------

探讨

引用:太感谢了,调试出来了,学到东西了优化一下PHP code
foreach ($ceshi as $v){
$zhishi=str_replace($v[0],$v[1],$zhishi);
}
echo $zhishi;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn