Home >Backend Development >PHP Tutorial > php中字符串中某一个字符的轮换

php中字符串中某一个字符的轮换

WBOY
WBOYOriginal
2016-06-13 12:58:52736browse

php中字符串中某一个字符的替换
例如:$author="|脑瘫|小儿脑瘫的原因|脑瘫先天性因素|"

修改为:$author="脑瘫,小儿脑瘫的原因,脑瘫先天性因素"

具体是去掉首位的|   中间的换成,

大神快点帮我解决下  PHP初学者

在线等!!!!
------解决方案--------------------
$author = str_replace('
------解决方案--------------------
', ',', trim($author, '
------解决方案--------------------
'));

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