Home  >  Article  >  Backend Development  >  如何去掉字符串的换行,tab 特殊字符

如何去掉字符串的换行,tab 特殊字符

WBOY
WBOYOriginal
2016-06-13 11:15:252090browse

怎么去掉字符串的换行,tab 特殊字符?
怎么去掉字符串的换行,tab 特殊字符?


------解决方案--------------------
str_replace('\n','',$content);
str_replace('\r','',$content);
str_replace('\t','',$content);
------解决方案--------------------
$s='aa	bb<br />cc';<br />echo preg_replace('/\s+/','',$s);

aabbcc
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