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

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

WBOY
Release: 2016-06-13 13:27:54
Original
1060 people have browsed it

求助个正则表达式 只一行 详细入贴
$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>
Copy after login
PHP code
rtrim($string, '<br />'); <div class="clear">
                 
              
              
        
            </div>
Copy after login
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