<?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[用PHP的方法shell的awk方法把QQ号码后两位屏蔽为*的方法]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Tue, 09 Nov 2010 06:55:42 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	方法零，直接截取：<br/><textarea name="code" class="html" rows="15" cols="100">
&lt;?php
echo substr(&#039;372647693&#039;, 0, -3) . &#039;***&#039;;
?&gt;
</textarea><br/>方法一,替换：<br/><br/><textarea name="code" class="html" rows="15" cols="100">
&lt;?php
echo preg_replace(&#039;/&#92;d&#123;3&#125;$/&#039;, &#039;***&#039;, &#039;372647693&#039;);
?&gt;
</textarea><br/>方法二,正则匹配:<br/><textarea name="code" class="html" rows="15" cols="100">
&lt;?php
$st[&#039;FQQ&#039;]=&#039;372647693&#039;;
preg_match_all(&quot;/^(.*)[0-9][0-9]/i&quot;,$st[&#039;FQQ&#039;], $out3);
print_r($out3);
?&gt;</textarea><br/><br/> php reg.php<br/>Array<br/>(<br/>&nbsp;&nbsp;&nbsp;&nbsp;[0] =&gt; Array<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0] =&gt; 372647693<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;[1] =&gt; Array<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0] =&gt; 3726476<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br/><br/>)<br/>取array的下标1即是$out3[1][0]后，加上**，即可！<br/><br/>方法2：<br/><div class="code">&lt;?php<br/>$st&#91;&#039;FQQ&#039;&#93;=&#039;372647693&#039;;<br/>$parttern=&quot;/^(&#92;d)(&#92;d+)(&#92;d&#123;2&#125;)$/&quot;;<br/>$replace=&quot;&#92;$1$2**&quot;;<br/>$qq=preg_replace($parttern,$replace,$st&#91;&#039;FQQ&#039;&#93;);<br/>echo $qq;<br/>?&gt;</div><br/><br/>php reg.php<br/>3726476**<br/><br/>方法3：<br/><br/><div class="code">&lt;?php<br/>$qq=&quot;372647693&quot;;<br/>$result = preg_replace(&#039;/^(.+).&#123;2&#125;$/&#039;, &#039;&#92;1**&#039;, $qq);<br/>echo $result;<br/>?&gt;</div><br/><br/>php reg.php&nbsp;&nbsp;<br/>3726476**<br/><br/>shell的awk方法实现：<br/><br/><div class="code"> cat&nbsp;&nbsp;xyz_zizuan.txt&nbsp;&nbsp;&#124;awk &#039;&#123;print substr($1,1,length($1)-2) &quot;**&quot;&#125;&#039; &gt; xyz_zizuan2.txt</div>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 用PHP的方法shell的awk方法把QQ号码后两位屏蔽为*的方法]]></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>