<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.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://www.jackxiang.com/post//</link>
<title><![CDATA[PHP处理control-M字符(^M)的方式]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Mon, 24 Jun 2013 06:31:36 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：在接口有奇怪的符号，如下：<br/>^M<br/>^M<br/>&#123;&quot;code&quot;:&quot;0&quot;,&quot;msg&quot;:&quot;参数无效&quot;&#125;<br/>代码(把^M 和换行全替换成空： &#92;r&#92;n 在Unix下显示是：^M且换行了)：<br/><textarea name="code" class="php" rows="15" cols="100">
 $trans = array(&quot;&#92;r&#92;n&quot; =&gt; &quot;&quot;); 
 $r= strtr($r,$trans);
</textarea><br/>现在好了。没有换行也没有M了,也可：<br/>vim编辑下，然后： :%s/&#92;r&#92;+$//e<br/>如直接用PHP的trim替换后，还是有换行，只是^m没了。就是下文的直接替换：<br/><br/><br/><br/>^M字符的问题。这个可以导致nginx出现400的错误响应，没法处理该请求。<br/><br/>// if you are upset with windows&#039; ^M characters at the end of the line,<br/>// these two lines are for you:<br/>$trans = array(&quot;&#92;x0D&quot; =&gt; &quot;&quot;);<br/>$text = strtr($orig_text,$trans);<br/><br/>// note that ctrl+M (in vim known as ^M) is hexadecimally 0x0D<br/><br/><br/>这个处理方式最简洁了，可以试试，php手册上的例子 <br/><br/><br/>来自：http://www.aslibra.com/blog/read.php/1718.htm
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] PHP处理control-M字符(^M)的方式]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>