<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[实践OK]PHP去除连续的空格和换行符，PHP中替换换行符。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Fri, 07 Mar 2014 06:41:38 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	一、PHP去除连续的空格和换行符:<br/>PHP去除连续的空格和换行符:<br/>http://www.zzsky.cn/build/content/1538.htm<br/><br/>php：去掉多余的空行:<br/>http://blog.sina.com.cn/s/blog_a3b9b9040101gvb5.html<br/><br/><textarea name="code" class="php" rows="15" cols="100">
$lastSeveralLineContentsArr = preg_replace(&quot;/([ &#124;&#92;t]&#123;0,&#125;[&#92;n]&#123;1,&#125;)&#123;2,&#125;/&quot;,&quot;&quot;,$lastSeveralLineContentsArr);//对Html里有连续的空行或tab给正则过滤掉&gt;，下面对post/get还原回空行。
</textarea><br/><br/><br/><br/>二、PHP中替换换行符：<br/>实践OK如下：<br/><textarea name="code" class="php" rows="15" cols="100">
echo str_replace(array(&quot;&#92;r&#92;n&quot;, &quot;&#92;r&quot;, &quot;&#92;n&quot;), &quot;&quot;, $scontents);&nbsp;&nbsp;
</textarea><br/>//php 有三种方法来解决 <br/>&nbsp;&nbsp;<br/>//1、使用str_replace 来替换换行 <br/>$str = str_replace(array(&quot;&#92;r&#92;n&quot;, &quot;&#92;r&quot;, &quot;&#92;n&quot;), &quot;&quot;, $str); <br/>&nbsp;&nbsp;<br/>//2、使用正则替换 <br/>$str = preg_replace(&#039;//s*/&#039;, &#039;&#039;, $str); <br/>&nbsp;&nbsp;<br/>//3、使用php定义好的变量 （建议使用） <br/>$str = str_replace(PHP_EOL, &#039;&#039;, $str);<br/><br/><br/>// 转为前台可显示的换行， nl2br 的方向函数参考php手册<br/>$str = &quot;a<br/>b<br/>e<br/>f<br/>c&quot;;<br/><br/>echo nl2br($str);<br/><br/>From:http://blog.csdn.net/zgmu/article/details/54574772
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]PHP去除连续的空格和换行符，PHP中替换换行符。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>