Home >Backend Development >PHP Tutorial >个正则表达式 只一行 详细入贴

个正则表达式 只一行 详细入贴

WBOY
WBOYOriginal
2016-06-13 10:27:25963browse

求助个正则表达式 只一行 详细入贴
$i = str_replace(":%s/
$/","",$i);

去掉行尾的一个
字符串如何写?
其实就是html_entity_decode后的


之去掉一个。

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

PHP code
$s='aa<br />bb';echo str_replace('<br />','',$s);<br><font color="#e78608">------解决方案--------------------</font><br>莫名其妙<br><font color="#e78608">------解决方案--------------------</font><br>/<br>$/i<br><font color="#e78608">------解决方案--------------------</font><br>
PHP code
rtrim($string, '<br />');<div class="clear">
                 
              
              
        
            </div>
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