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

替换多个字符串解决方案

WBOY
Release: 2016-06-13 13:31:44
Original
877 people have browsed it

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

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

探讨

引用:太感谢了,调试出来了,学到东西了优化一下PHP code
foreach ($ceshi as $v){
$zhishi=str_replace($v[0],$v[1],$zhishi);
}
echo $zhishi;
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template