<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>码农的生活 &#187; PHP</title>
	<atom:link href="http://www.61php.com/?cat=4&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.61php.com</link>
	<description>卢逸phper</description>
	<lastBuildDate>Fri, 20 May 2016 06:20:48 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>61php 框架正式开源</title>
		<link>http://www.61php.com/?p=124</link>
		<comments>http://www.61php.com/?p=124#comments</comments>
		<pubDate>Fri, 20 May 2016 06:20:48 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=124</guid>
		<description><![CDATA[https://git.oschina.net/61php/PHP-framework-61php 源地址]]></description>
				<content:encoded><![CDATA[<p>https://git.oschina.net/61php/PHP-framework-61php</p>
<p>源地址</p>
]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP判断客户端是否使用代理服务器及其匿名级别</title>
		<link>http://www.61php.com/?p=107</link>
		<comments>http://www.61php.com/?p=107#comments</comments>
		<pubDate>Fri, 18 Sep 2015 08:37:49 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=107</guid>
		<description><![CDATA[要判断客户端是否使用代理服务器，可以从客户端所发送的环境变量信息来判断。 具体来说，就是看HTTP_VIA字段... <a href="http://www.61php.com/?p=107">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>要判断客户端是否使用代理服务器，可以从客户端所发送的环境变量信息来判断。<br />
具体来说，就是看HTTP_VIA字段，如果这个字段设置了，说明客户端使用了代理服务器。<br />
匿名级别可以参考下表来判断。</p>
<p>一、没有使用代理服务器的情况：<br />
REMOTE_ADDR = 您的 IP<br />
HTTP_VIA = 没数值或不显示<br />
HTTP_X_FORWARDED_FOR = 没数值或不显示</p>
<p>二、使用透明代理服务器的情况：Transparent Proxies<br />
REMOTE_ADDR = 代理服务器 IP<br />
HTTP_VIA = 代理服务器 IP (补充：这个字段由代理服务器填充，有时会填充网关信息等)<br />
HTTP_X_FORWARDED_FOR = 您的真实 IP<br />
这类代理服务器还是将您的信息转发给您的访问对象，无法达到隐藏真实身份的目的。</p>
<p>三、使用普通匿名代理服务器的情况：Anonymous Proxies<br />
REMOTE_ADDR = 代理服务器 IP<br />
HTTP_VIA = 代理服务器 IP (补充：这个字段由代理服务器填充，有时会填充网关信息等)<br />
HTTP_X_FORWARDED_FOR = 代理服务器 IP<br />
隐藏了您的真实IP，但是向访问对象透露了您是使用代理服务器访问他们的。</p>
<p>四、使用欺骗性代理服务器的情况：Distorting Proxies<br />
REMOTE_ADDR = 代理服务器 IP<br />
HTTP_VIA = 代理服务器 IP  (补充：这个字段由代理服务器填充，有时会填充网关信息等)<br />
HTTP_X_FORWARDED_FOR = 随机的 IP<br />
告诉了访问对象您使用了代理服务器，但编造了一个虚假的随机IP代替您的真实IP欺骗它。</p>
<p>五、使用高匿名代理服务器的情况：High Anonymity Proxies<br />
REMOTE_ADDR = 代理服务器 IP<br />
HTTP_VIA = 没数值或不显示<br />
HTTP_X_FORWARDED_FOR = 没数值或不显示<br />
完全用代理服务器的信息替代了您的所有信息，就象您就是完全使用那台代理服务器直接访问对象。<br />
除此之外，可以通过proxy judges总 结其他一些可供参考的判定信息，一遍于在实践中加以利用。</p>
<p>最后写一个php例子,仅供大家参考:</p>

<div class="wp_codebox"><table><tr id="p1072"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code" id="p107code2"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_VIA'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>    <span style="color: #666666; font-style: italic;">//使用了代理</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_X_FORWARDED_FOR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//Anonymous Proxies    普通匿名代理服务器</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//代理IP地址为 $_SERVER['REMOTE_ADDR']</span>
&nbsp;
   <span style="color: #009900;">&#125;</span>
   <span style="color: #b1b100;">else</span>
   <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//Transparent Proxies 透明代理服务器</span>
        <span style="color: #666666; font-style: italic;">//代理IP地址为 $_SERVER['REMOTE_ADDR']</span>
        <span style="color: #666666; font-style: italic;">//真实ip地址为 $_SERVER['HTTP_X_FORWARDED_FOR']</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>    <span style="color: #666666; font-style: italic;">//没有代理或者是高匿名代理</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//真实ip地址为 $_SERVER['REMOTE_ADDR']</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=107</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP接口类interface的正确使用方法</title>
		<link>http://www.61php.com/?p=88</link>
		<comments>http://www.61php.com/?p=88#comments</comments>
		<pubDate>Fri, 17 Jul 2015 05:36:26 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=88</guid>
		<description><![CDATA[对于那些初学PHP语言的人来说，对于PHP的接口类也许了解的还不是很深入，接下来我们就来具体讲述PHP接口类i... <a href="http://www.61php.com/?p=88">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>对于那些初学PHP语言的人来说，对于PHP的接口类也许了解的还不是很深入，接下来我们就来具体讲述PHP接口类interface的使用方法。</p>
<p>其实他们的作用很简单，当有很多人一起开发一个项目时，可能都会去调用别人写的一些类，那你就会问，我怎么知道他的某个功能的实现方法是怎么命名的呢，这个时候PHP接口类interface就起到作用了，当我们定义了一个接口类时，它里面的方式是下面的子类必须实现的，比如 :</p>

<div class="wp_codebox"><table><tr id="p885"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p88code5"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">interface</span> Shop  
<span style="color: #009900;">&#123;</span>  
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> buy<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sell<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> view<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>我声明一个shop接口类，定义了三个方法：买(buy),卖(sell),看(view),那么继承此类的所有子类都必须实现这3个方法少一个都不行，如果子类没有实现这些话，就无法运行。实际上接口类说白了，就是一个类的模板，一个类的规定，如果你属于这类，你就必须遵循我的规定，少一个都不行，但是具体你怎么去做，我不管，那是你的事，如：</p>

<div class="wp_codebox"><table><tr id="p886"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p88code6"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> BaseShop implements Shop  
<span style="color: #009900;">&#123;</span>  
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> buy<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gid</span><span style="color: #009900;">&#41;</span>  
    <span style="color: #009900;">&#123;</span>  
        <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'你购买了ID为 :'</span><span style="color: #339933;">.</span><span style="color: #000088;">$gid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'的商品'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
    <span style="color: #009900;">&#125;</span>  
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sell<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gid</span><span style="color: #009900;">&#41;</span>  
    <span style="color: #009900;">&#123;</span>  
        <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'你卖了ID为 :'</span><span style="color: #339933;">.</span><span style="color: #000088;">$gid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'的商品'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
    <span style="color: #009900;">&#125;</span>  
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> view<span style="color: #009900;">&#40;</span><span style="color: #000088;">$gid</span><span style="color: #009900;">&#41;</span>  
    <span style="color: #009900;">&#123;</span>  
        <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'你查看了ID为 :'</span><span style="color: #339933;">.</span><span style="color: #000088;">$gid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'的商品'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
    <span style="color: #009900;">&#125;</span>  
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>你想想，在一个多人合作的大项目里面，有了接口类是多么的方便，这样你就不用去问别人，你的某某功能的方法名是什么了，当然如果你们喜欢这样我也没有办法。</p>
<p>结论 ： PHP接口类interface就是一个类的领导者，指明方向，子类必须完成它指定方法。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=88</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php浮点数判断BUG</title>
		<link>http://www.61php.com/?p=72</link>
		<comments>http://www.61php.com/?p=72#comments</comments>
		<pubDate>Tue, 12 May 2015 08:26:01 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=72</guid>
		<description><![CDATA[最近一个朋友碰到个问题,比较神奇 1 2 3 4 5 6 7 var_dump&#40;is_float&#4... <a href="http://www.61php.com/?p=72">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>最近一个朋友碰到个问题,比较神奇</p>

<div class="wp_codebox"><table><tr id="p729"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p72code9"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/var_dump"><span style="color: #990000;">var_dump</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_float"><span style="color: #990000;">is_float</span></a><span style="color: #009900;">&#40;</span><span style="color:#800080;">1.1</span><span style="color: #339933;">+</span><span style="color:#800080;">0.1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/var_dump"><span style="color: #990000;">var_dump</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_float"><span style="color: #990000;">is_float</span></a><span style="color: #009900;">&#40;</span><span style="color:#800080;">1.2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color:#800080;">1.2</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color:#800080;">1.1</span><span style="color: #339933;">+</span><span style="color:#800080;">0.1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>结果是 true<br />
网上查了一下，原因如下</p>
<p>如果用php的+-*/计算浮点数时，可能会遇到一些计算结果错误的问题，比如echo intval( 0.58*100 );会打印57，而不是58，这个其实是计算机底层二进制无法精确表示浮点数的一个bug，是跨语言的</p>
<p>那么运算浮点数用一些php特有的运算函数<br />
例如 bcadd() 把两个浮点数相加</p>

<div class="wp_codebox"><table><tr id="p7210"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p72code10"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color:#800080;">1.2</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>bcadd<span style="color: #009900;">&#40;</span><span style="color:#800080;">1.1</span><span style="color: #339933;">,</span><span style="color:#800080;">0.1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://www.61php.com/wp-content/uploads/2015/05/QQ图片20150512163947.png"><img class="alignnone size-medium wp-image-77" src="http://www.61php.com/wp-content/uploads/2015/05/QQ图片20150512163947.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>希望儿子健康成长</title>
		<link>http://www.61php.com/?p=68</link>
		<comments>http://www.61php.com/?p=68#comments</comments>
		<pubDate>Mon, 04 May 2015 03:30:57 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=68</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.61php.com/wp-content/uploads/2015/05/untitled.png"><img class="alignnone size-medium wp-image-69" src="http://www.61php.com/wp-content/uploads/2015/05/untitled-169x300.png" alt="untitled" width="169" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=68</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>身份证校验码计算公式及实例计算</title>
		<link>http://www.61php.com/?p=61</link>
		<comments>http://www.61php.com/?p=61#comments</comments>
		<pubDate>Thu, 23 Apr 2015 01:59:30 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=61</guid>
		<description><![CDATA[校验码是识别一个身份证号码是否真实存在的重要的依据。那我们要如何通过校验码来判断一个身份证号码是否真实的呢？ ... <a href="http://www.61php.com/?p=61">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>校验码是识别一个身份证号码是否真实存在的重要的依据。那我们要如何通过校验码来判断一个身份证号码是否真实的呢？</p>
<p>校验码如何判断身份证号码真伪呢？我们来看看具体计划过程。</p>
<p>第一步：将身份证号码的第1位数字与7相乘；将身份证号码的第2位数字与9相乘；将身份证号码的第3位数字与10相乘；将身份证号码的第4位数字与5相乘；将身份证号码的第5位数字与8相乘；将身份证号码的第6位数字与4相乘；将身份证号码的第7位数字与2相乘；将身份证号码的第8位数字与1相乘；将身份证号码的第9位数字与6相乘；将身份证号码的第10位数字与3相乘；将身份证号码的第11位数字与7相乘；将身份证号码的第12位数字与9相乘；将身份证号码的第13位数字与10相乘；将身份证号码的第14位数字与5相乘；将身份证号码的第15位数字与8相乘；将身份证号码的第16位数字与4相乘；将身份证号码的第17位数字与2相乘。</p>
<p>第二步：将第一步身份证号码1~17位相乘的结果求和，全部加起来。</p>
<p>第三步：用第二步计算出来的结果除以11，这样就会出现余数为0，余数为1，余数为2，余数为3，余数为4，余数为5，余数为6，余数为7，余数为8，余数为9，余数为10共11种可能性。</p>
<p>第四步：如果余数为0，那对应的最后一位身份证的号码为1；如果余数为1，那对应的最后一位身份证的号码为0；如果余数为2，那对应的最后一位身份证的号码为X；如果余数为3，那对应的最后一位身份证的号码为9；如果余数为4，那对应的最后一位身份证的号码为8；如果余数为5，那对应的最后一位身份证的号码为7；如果余数为6，那对应的最后一位身份证的号码为6；如果余数为7，那对应的最后一位身份证的号码为5；如果余数为8，那对应的最后一位身份证的号码为4；如果余数为9，那对应的最后一位身份证的号码为3；如果余数为10，那对应的最后一位身份证的号码为2。</p>
<p>比如： 身份证号码 432831196411150810  这个身份证是否是有效身份证号码呢？请看校验码分析。</p>
<p><a href="http://www.61php.com/wp-content/uploads/2015/04/7ac880510fb30f24807bdc6aca95d143ac4b03b2.jpg"><img class="alignnone size-medium wp-image-64" src="http://www.61php.com/wp-content/uploads/2015/04/7ac880510fb30f24807bdc6aca95d143ac4b03b2.jpg" alt="7ac880510fb30f24807bdc6aca95d143ac4b03b2" /></a></p>
<p>校验码是0，身份证号码 432831196411150810中最后一位是0，所以这是一个有效的身份证号码。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=61</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一张图看懂单机部署+集群部署+热备部署与磁盘阵列（RAID）</title>
		<link>http://www.61php.com/?p=52</link>
		<comments>http://www.61php.com/?p=52#comments</comments>
		<pubDate>Wed, 15 Apr 2015 03:13:15 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=52</guid>
		<description><![CDATA[单机部署 集群部署 热备部署 单机部署（stand-alone）：只有一个饮水机提供服务，服务只部署一份 集群... <a href="http://www.61php.com/?p=52">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.habadog.com/wp-content/uploads/2014/10/RAID-2014.jpg"><img class="size-full wp-image-585" title="RAID-2014" src="http://www.habadog.com/wp-content/uploads/2014/10/RAID-2014.jpg" alt="" width="416" height="345" /></a></p>
<p><strong>单机部署 集群部署 热备部署</strong><br />
<strong>单机部署</strong>（stand-alone）：只有一个饮水机提供服务，服务只部署一份<br />
<strong>集群部署</strong>（cluster）：有多个饮水机同时提供服务，服务冗余部署，每个冗余的服务都对外提供服务<br />
<strong>热备部署</strong>（hot-swap）：只有一个桶提供服务，另一个桶stand-by，在水用完时自动热替换，服务冗余部署，只有一个主服务对外提供服务，影子服务在主服务挂掉时顶上</p>
<p><strong>磁盘阵列RAID（Redundant Arrays of independent Disks）</strong></p>
<p><a href="http://www.habadog.com/wp-content/uploads/2014/10/raid0.gif"><img class="size-full wp-image-589" title="raid0" src="http://www.habadog.com/wp-content/uploads/2014/10/raid0.gif" alt="" width="200" height="200" /></a></p>
<p><strong>RAID0</strong>：存储性能高的磁盘阵列，又称striping，它的原理是，将连续的数据分散到不同的磁盘上存储，这些不同的磁盘能同时并行存取数据</p>
<p><a href="http://www.habadog.com/wp-content/uploads/2014/10/raid1.gif"><img class="size-full wp-image-590" title="raid1" src="http://www.habadog.com/wp-content/uploads/2014/10/raid1.gif" alt="" width="200" height="200" /></a></p>
<p><strong>RAID1</strong>：安全性高的磁盘阵列，又称mirror，它的原理是，将数据完全复制到另一个磁盘上，磁盘空间利用率只有50%<br />
<strong>RAID0+1</strong>：RAID0和RAID1的综合方案，速度快，安全性又高，但是很贵，这也是国企用的比较多的存储方案</p>
<p><a href="http://www.habadog.com/wp-content/uploads/2014/10/raid5.gif"><img class="size-full wp-image-591" title="raid5" src="http://www.habadog.com/wp-content/uploads/2014/10/raid5.gif" alt="" width="200" height="200" /></a></p>
<p><strong>RAID5</strong>：RAID0和RAID1的折衷方案，读取速度比较快（不如RAID0，因为多存储了校验位），安全性也很高（可以利用校验位恢复数据），空间利用率也不错（不完全复制，只冗余校验位），这也是互联网公司用的比较多的存储方案</p>
<p>转载出处：http://www.habadog.com/2014/10/24/stand-alone-cluster-hot-swap-raid/#rd?sukey=39297060d6d3d557578a5b49ad3cdba2f6c8ef0b1a3da573df8b61387c4d89929b734f47ece4095f4582f0e87aa87b2d</p>
]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=52</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>正则取回所有的url GET值包括数组get</title>
		<link>http://www.61php.com/?p=47</link>
		<comments>http://www.61php.com/?p=47#comments</comments>
		<pubDate>Wed, 25 Mar 2015 09:24:19 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=47</guid>
		<description><![CDATA[61原创，转载请注明出处 用一个正则，取出制定的url下的所有get值，包括二维数组 1 2 3 4 5 6 ... <a href="http://www.61php.com/?p=47">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>61原创，转载请注明出处<br />
用一个正则，取出制定的url下的所有get值，包括二维数组</p>

<div class="wp_codebox"><table><tr id="p4712"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code" id="p47code12"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://news.souhu.com/index.php?op=news&amp;task=contentlist&amp;cid=1&amp;id=2&amp;ha[]=12&amp;ha[]=14&amp;ha[]=33&amp;aa[]=1&amp;aa[]=2&quot;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$pattern</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/(\?|=|&amp;)((?&lt;key&gt;[^\[=]+)|(?&lt;a_key&gt;[^\[]+)\[\])=(?&lt;value&gt;[^&amp;]+)/&quot;</span><span style="color: #339933;">;</span> 
<a href="http://www.php.net/preg_match_all"><span style="color: #990000;">preg_match_all</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">//整理取回的结果 </span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'key'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
    <span style="color: #000088;">$value</span><span style="color: #339933;">=</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
        <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$v</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$value</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span> 
        <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a_key'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$value</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span> 
&nbsp;
<a href="http://www.php.net/print_r"><span style="color: #990000;">print_r</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=47</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php定界符</title>
		<link>http://www.61php.com/?p=43</link>
		<comments>http://www.61php.com/?p=43#comments</comments>
		<pubDate>Wed, 25 Mar 2015 09:21:46 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61php.com/?p=43</guid>
		<description><![CDATA[解决大段的php中需要 echo html代码是，不需要大量的转义换行等，直接用定界符 1 2 3 4 5 6... <a href="http://www.61php.com/?p=43">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>解决大段的php中需要 echo html代码是，不需要大量的转义换行等，直接用定界符</p>

<div class="wp_codebox"><table><tr id="p4314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p43code14"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>    
  <span style="color: #000088;">$x1</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&lt;&lt;&lt;</span>s333
    This is Test<span style="color: #339933;">;</span>
  s333<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$x2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&lt;&lt;&lt;</span>TEST
    <span style="color: #000088;">$x1</span>
  TEST<span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$x3</span><span style="color: #339933;">=&lt;&lt;&lt;</span>AAA
  aaaa <span style="color: #000088;">$x2</span>
 AAA<span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$x3</span> &quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=43</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SmartyBC.class.php介绍</title>
		<link>http://www.61php.com/?p=40</link>
		<comments>http://www.61php.com/?p=40#comments</comments>
		<pubDate>Wed, 13 Aug 2014 09:07:09 +0000</pubDate>
		<dc:creator><![CDATA[卢逸]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.61blog.net/?p=40</guid>
		<description><![CDATA[SmartyBC.class.php 是smarty3向下兼容类.里面包含了smarty2中被删除的funct... <a href="http://www.61php.com/?p=40">Continue Reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>SmartyBC.class.php</p>
<p>是smarty3向下兼容类.里面包含了smarty2中被删除的function</p>
<p>如果是smarty2升级到smarty3</p>
<p>只需要引用 SmartyBC.class.php</p>
<p>并且实例化 $smarty = new SmartyBC(); 即可兼容老的smarty2的程序</p>
]]></content:encoded>
			<wfw:commentRss>http://www.61php.com/?feed=rss2&#038;p=40</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
