<?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>Azone&#039;s Blog &#187; PHP</title>
	<atom:link href="http://www.firestudio.cn/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.firestudio.cn</link>
	<description>用到一点记录一点。</description>
	<lastBuildDate>Thu, 01 Dec 2011 03:20:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>通过数组方式访问PHP对象属性</title>
		<link>http://www.firestudio.cn/2010/05/21/162.html</link>
		<comments>http://www.firestudio.cn/2010/05/21/162.html#comments</comments>
		<pubDate>Fri, 21 May 2010 03:59:49 +0000</pubDate>
		<dc:creator>Yozone Wong</dc:creator>
				<category><![CDATA[PHP编程]]></category>
		<category><![CDATA[应用技巧]]></category>
		<category><![CDATA[ArrayAcces]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php数组访问对象]]></category>

		<guid isPermaLink="false">http://www.firestudio.cn/?p=162</guid>
		<description><![CDATA[以前看到过新版本的Symfony的Form文档，在类中可以通过$this['key']的方法来访问当前对象中的widgets，我一直很诧异，为什么可以这样用呢？我试验过很多方法都没成功，今天终于找到答案了。 方法其实很简单，需要在类中继承PHP预定义接口ArrayAccess，并且包含offsetGet, offsetSet, offsetExists和offsetUnset四个方法就可以实现上述功能了。下面来举个例子： &#38;lt; ?php class test implements ArrayAccess &#123; private $_result = array&#40;'name' =&#38;gt; 'Yozone', 'age' =&#38;gt; '24'&#41;; public function offsetGet&#40;$key&#41; &#123; return $this-&#38;gt;_result&#91;$key&#93;; &#125; public function offsetExists&#40;$key&#41; &#123; return isset&#40;$this-&#38;gt;_result&#91;$key&#93;&#41;; &#125; public function offsetSet&#40;$key, $value&#41; &#123; $this-&#38;gt;_result&#91;$key&#93; = $value; &#125; public function offsetUnset&#40;$key&#41; &#123; unset&#40;$key&#41;; &#125; public function getName&#40;&#41; &#123; return $this&#91;'name'&#93;; [...]]]></description>
		<wfw:commentRss>http://www.firestudio.cn/2010/05/21/162.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>利用Nginx或者Apache和PHP配合将网页变成黑白版</title>
		<link>http://www.firestudio.cn/2010/04/21/151.html</link>
		<comments>http://www.firestudio.cn/2010/04/21/151.html#comments</comments>
		<pubDate>Wed, 21 Apr 2010 15:52:26 +0000</pubDate>
		<dc:creator>Yozone Wong</dc:creator>
				<category><![CDATA[PHP编程]]></category>
		<category><![CDATA[应用技巧]]></category>
		<category><![CDATA[网页相关]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[网页灰色]]></category>
		<category><![CDATA[黑白网页]]></category>

		<guid isPermaLink="false">http://www.firestudio.cn/?p=151</guid>
		<description><![CDATA[今天看到很多网站的网页都变成灰色了，很多是使用了IE的滤镜，但是在非IE下就失效了，有的用的是另做的一套黑白图片实现网页的黑白版，这样显得又太麻烦。 记得前一段时间看到老外的一篇利用Apache的mod_rewrite模块和php结合实现网站图片水印的文章，今天受到此文章的启发我就想能不能利用同样的原理来实现将网站的所有图片都变成黑白的呢？经过今天的实验，我成功了！证明我的想法是正确的！下面就介绍一下如何利用apache或者nginx与php的结合来实现黑白版的网页。 首先修改网站的apache配置文件（.htaccess也行）或者nginx的配置文件： Apache： RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f RewriteRule \.(gif&#124;jpeg&#124;jpg&#124;png)$ img_to_black_write.php [QSA,NC] Nginx（在server中加入）: if (!-f $request_filename) { rewrite ^(.*)\.(jpg&#124;png&#124;gif)$ /img_to_black_write.php; } 这里是img_to_black_write.php的代码 &#38;lt; ?php $file = $_SERVER&#91;'DOCUMENT_ROOT'&#93; . $_SERVER&#91;'REQUEST_URI'&#93;; $im = imagecreatefromstring&#40;file_get_contents&#40;$file&#41;&#41;; if &#40;imageistruecolor&#40;$im&#41;&#41; &#123; imagetruecolortopalette&#40;$im, true, 256&#41;; &#125; $total_colors = imagecolorstotal&#40;$im&#41;; &#160; for &#40;$i = 0; $i &#38;lt; $total_colors; $i++&#41;&#123; $rgb = imagecolorsforindex&#40;$im, [...]]]></description>
		<wfw:commentRss>http://www.firestudio.cn/2010/04/21/151.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>很简单、很快速的格式化文件大小</title>
		<link>http://www.firestudio.cn/2008/10/30/46.html</link>
		<comments>http://www.firestudio.cn/2008/10/30/46.html#comments</comments>
		<pubDate>Thu, 30 Oct 2008 09:36:46 +0000</pubDate>
		<dc:creator>Yozone Wong</dc:creator>
				<category><![CDATA[PHP编程]]></category>
		<category><![CDATA[应用技巧]]></category>
		<category><![CDATA[File size format]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.firestudio.cn/?p=46</guid>
		<description><![CDATA[今天在PHP官网（http://www.php.net）上面查询number_format函数的时候发现了一小段代码，虽然很短，但是我觉得很有用，最主要的是我受到了很多启发，下面把那段代码贴出来以便共享，:) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 &#60; ?php function format_filesize&#40;$number, $decimals = 3, $force_unit = false, $dec_char = ',', $thousands_char = ' '&#41; &#123; //string format_filesize(int(0,) $number, (bool(0), int(0,4)) $force_unit, int $decimals, char $dec_char, char $thousands_char) //format a filesize $number with unit (setted by $force_unit(see [...]]]></description>
		<wfw:commentRss>http://www.firestudio.cn/2008/10/30/46.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>刚刚给图片转换器加了改变大小的功能</title>
		<link>http://www.firestudio.cn/2008/06/04/38.html</link>
		<comments>http://www.firestudio.cn/2008/06/04/38.html#comments</comments>
		<pubDate>Wed, 04 Jun 2008 15:09:05 +0000</pubDate>
		<dc:creator>Yozone Wong</dc:creator>
				<category><![CDATA[PHP编程]]></category>
		<category><![CDATA[Image Converter]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.firestudio.cn/?p=38</guid>
		<description><![CDATA[刚刚完成了上次写的图片转换器的改变大小的功能，如果还有什么需要赶紧的希望大家指出来，以方便尽我的能力对其进行改进（这是我没事写着玩的，:)，纯属兴趣），网址：http://www.firestudio.cn/home/imageConverter.php]]></description>
		<wfw:commentRss>http://www.firestudio.cn/2008/06/04/38.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>图片转换器（我自己写的，大家赏个脸，给点意见~）</title>
		<link>http://www.firestudio.cn/2008/05/30/36.html</link>
		<comments>http://www.firestudio.cn/2008/05/30/36.html#comments</comments>
		<pubDate>Fri, 30 May 2008 03:44:39 +0000</pubDate>
		<dc:creator>Yozone Wong</dc:creator>
				<category><![CDATA[PHP编程]]></category>
		<category><![CDATA[Image Converter]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.firestudio.cn/?p=36</guid>
		<description><![CDATA[我昨天晚上写了一个图片转换的小程序（没有完成），刚刚把它搞定，很简单的一种，现丑了，呵呵~。其中包括从彩色到黑白的转换，图片质量的改变，是否交错 以及图片格式的转换（PNG, GIF和JPEG格式之间的转换）。下个星期我准备再对它进行完善一点，加点功能（比如调整大小）。有兴趣的朋友可以试一下给点意见。 图片转换器地址：http://www.firestudio.cn/home/imageConverter.php]]></description>
		<wfw:commentRss>http://www.firestudio.cn/2008/05/30/36.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

