<?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.jiehoo.me/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jiehoo.me</link>
	<description>解己之惑，解人之惑</description>
	<lastBuildDate>Mon, 19 Jul 2010 10:01:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Windows+Apache+PHP5+MYSQL5</title>
		<link>http://www.jiehoo.me/windows-apache-php-mysql-install-guide.htm</link>
		<comments>http://www.jiehoo.me/windows-apache-php-mysql-install-guide.htm#comments</comments>
		<pubDate>Tue, 15 Sep 2009 09:20:42 +0000</pubDate>
		<dc:creator>Cherami</dc:creator>
				<category><![CDATA[软件开发]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.jiehoo.com/windows-apache-php-mysql-install-guide.htm</guid>
		<description><![CDATA[打算玩玩Drupal，就搭了个环境，不是很难，但是还是遇到不少问题。 先安装Apache，直接下载Installer安装就行了，没有啥特殊的。 安装MYSQL5，也没有啥特殊的，不过有一点，在Windows下，貌似和Linux下不同，我记得原来linux下mysql的admin用户的用户名是sa，但是在windows下变成root了？还是我记性出错？版本更新？ 最后讲PHP，因为问题都是它惹的。 第一，不要下载PHP5.3，因为貌似里面不带php5apache2.dll 第二，下载php5.2的zip包，建议不要下installer，因为网上的文章基本上都是基于zip的 第三，解压到例如c:\php目录下 第四，复制php.ini-dist或者php.ini-recommended为php.ini，修改下php.ini文件，把;extension=php_mysql.dll和;extension=php_mysqli.dll这两行前面的分号去掉 第五，修改httpd.conf，添加如下内容： LoadModule php5_module &#34;C:/PHP/php5apache2_2.dll&#34; PHPIniDir &#34;C:/PHP&#34; AddType application/x-httpd-php .php AddType application/x-httpd-php .html 注意上面的php5apache2_2.dll，如果你安装的apache是2.0系列的，就是php5apache2.dll 第六，把c:\php和c:\php\ext加入系统的PATH环境变量里面 第七，重启计算机 好了，这个PHP的环境才算搭建好了。 把drupal解压到apache的htdocs下，访问那个install.php就可以了（记得先在mysql下面建个数据库，不需要建任何表）。]]></description>
			<content:encoded><![CDATA[<p class='fp'>打算玩玩Drupal，就搭了个环境，不是很难，但是还是遇到不少问题。<br />
先安装Apache，直接下载Installer安装就行了，没有啥特殊的。<br />
安装MYSQL5，也没有啥特殊的，不过有一点，在Windows下，貌似和Linux下不同，我记得原来linux下mysql的admin用户的用户名是sa，但是在windows下变成root了？还是我记性出错？版本更新？<br />
最后讲PHP，因为问题都是它惹的。<br />
第一，不要下载PHP5.3，因为貌似里面不带php5apache2.dll<br />
第二，下载php5.2的zip包，建议不要下installer，因为网上的文章基本上都是基于zip的<br />
第三，解压到例如c:\php目录下<br />
第四，复制php.ini-dist或者php.ini-recommended为php.ini，修改下php.ini文件，把;extension=php_mysql.dll和;extension=php_mysqli.dll这两行前面的分号去掉<br />
第五，修改httpd.conf，添加如下内容：<br />
LoadModule php5_module &quot;C:/PHP/php5apache2_2.dll&quot;<br />
PHPIniDir &quot;C:/PHP&quot;<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php .html</p>
<p>注意上面的php5apache2_2.dll，如果你安装的apache是2.0系列的，就是php5apache2.dll<br />
第六，把c:\php和c:\php\ext加入系统的PATH环境变量里面<br />
第七，重启计算机</p>
<p>好了，这个PHP的环境才算搭建好了。<br />
把drupal解压到apache的htdocs下，访问那个install.php就可以了（记得先在mysql下面建个数据库，不需要建任何表）。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiehoo.me/windows-apache-php-mysql-install-guide.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP的函数返回值</title>
		<link>http://www.jiehoo.me/php-function-return-type.htm</link>
		<comments>http://www.jiehoo.me/php-function-return-type.htm#comments</comments>
		<pubDate>Sat, 13 Jan 2007 14:06:16 +0000</pubDate>
		<dc:creator>Cherami</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[返回值]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jiehoo.com/php-function-return-type.htm</guid>
		<description><![CDATA[本来就是想修改下header.php，让我的标签列表以及分类列表的标题更好一些，因为原来的标签文章列表的标题和站点首页的是一样的，在搜索引擎收录信息里面都是一样的，不好区分，这么一个简单的功能，本来以为一分钟可以搞定的，结果因为不熟悉PHP的语法，足足弄了半个小时才搞定。原理很简单，就是取得页面的URI的值，然后判断是否包含/tag/或者/category/： &#60;?php if ( strpos($_SERVER[&#34;REQUEST_URI&#34;],&#8217;/tag/&#8217;)==0 ) { ?&#62; &#38;raquo; 标签 &#38;raquo; &#60;?php&#160; echo(urldecode(substr($_SERVER[&#34;REQUEST_URI&#34;],5))); } ?&#62; &#60;?php if ( strpos($_SERVER[&#34;REQUEST_URI&#34;],&#8217;/category/&#8217;)==0 ) { ?&#62; &#38;raquo; 分类 &#60;?php } ?&#62; 问题是strpos在没有匹配的时候返回FALSE，而PHP不是强类型语言，有匹配返回但是是第一个匹配的时候，返回的是0，而在弱类型的时候，FALSE的等价值就是0，所以上面的判断就是错的。 后来看下了手册里面，注意到里面特别提到了===判断，就是进行强类型检查的，所以修改为： &#60;?php if ( strpos($_SERVER[&#34;REQUEST_URI&#34;],&#8217;/tag/&#8217;)===0 ) { ?&#62; &#38;raquo; 标签 &#38;raquo; &#60;?php&#160; echo(urldecode(substr($_SERVER[&#34;REQUEST_URI&#34;],5))); } ?&#62; &#60;?php if ( strpos($_SERVER[&#34;REQUEST_URI&#34;],&#8217;/category/&#8217;)===0 ) { ?&#62; &#38;raquo; 分类 &#60;?php } ?&#62; [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>本来就是想修改下header.php，让我的标签列表以及分类列表的标题更好一些，因为原来的标签文章列表的标题和站点首页的是一样的，在搜索引擎收录信息里面都是一样的，不好区分，这么一个简单的功能，本来以为一分钟可以搞定的，结果因为不熟悉PHP的语法，足足弄了半个小时才搞定。原理很简单，就是取得页面的URI的值，然后判断是否包含/tag/或者/category/：<br />
&lt;?php if ( strpos($_SERVER[&quot;REQUEST_URI&quot;],&#8217;/tag/&#8217;)==0 ) { ?&gt; &amp;raquo; 标签 &amp;raquo; &lt;?php&nbsp; echo(urldecode(substr($_SERVER[&quot;REQUEST_URI&quot;],5))); } ?&gt; &lt;?php if ( strpos($_SERVER[&quot;REQUEST_URI&quot;],&#8217;/category/&#8217;)==0 ) { ?&gt; &amp;raquo; 分类 &lt;?php } ?&gt;<br />
问题是strpos在没有匹配的时候返回FALSE，而PHP不是强类型语言，有匹配返回但是是第一个匹配的时候，返回的是0，而在弱类型的时候，FALSE的等价值就是0，所以上面的判断就是错的。<br />
后来看下了手册里面，注意到里面特别提到了===判断，就是进行强类型检查的，所以修改为：<br />
&lt;?php if ( strpos($_SERVER[&quot;REQUEST_URI&quot;],&#8217;/tag/&#8217;)===0 ) { ?&gt; &amp;raquo; 标签 &amp;raquo; &lt;?php&nbsp; echo(urldecode(substr($_SERVER[&quot;REQUEST_URI&quot;],5))); } ?&gt; &lt;?php if ( strpos($_SERVER[&quot;REQUEST_URI&quot;],&#8217;/category/&#8217;)===0 ) { ?&gt; &amp;raquo; 分类 &lt;?php } ?&gt;</p>
<p>问题搞定。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiehoo.me/php-function-return-type.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP中文乱码的一个解决方法</title>
		<link>http://www.jiehoo.me/resolve-php-mess-up.htm</link>
		<comments>http://www.jiehoo.me/resolve-php-mess-up.htm#comments</comments>
		<pubDate>Fri, 27 Oct 2006 01:48:54 +0000</pubDate>
		<dc:creator>Cherami</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jiehoo.com/php%e4%b8%ad%e6%96%87%e4%b9%b1%e7%a0%81%e7%9a%84%e4%b8%80%e4%b8%aa%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95.htm</guid>
		<description><![CDATA[我说的中文乱码不是全部是乱码，而是部分是乱码，例如海明威主题里面默认的那个single.php页面里面包含edit this entry的链接，我修改为中文不行，变成乱码了，但是其它的中文都没有问题，原因不明。一个解决的方法就是把中文换成HTML的转义格式，也就是&#38;#加上一个数字并加一个分号的格式。 但是如何得到汉字对应的那个字符串呢？呵呵，很简单，那个数字就是汉字的Unicode的值，下面的这个Java方法就可以转换，网上我找到过一个对应表，但是中文显示不出来，暂时就用这个方法了： &#160;&#160;&#160; public static String convertToHTMLEscapeFormat(String original) &#160;&#160;&#160; { &#160;&#160;&#160;&#160;&#160;&#160;&#160; char b[] = original.toCharArray(); &#160;&#160;&#160;&#160;&#160;&#160;&#160; StringBuffer result = new StringBuffer(); &#160;&#160;&#160;&#160;&#160;&#160;&#160; for (int i = 0; i &#60; b.length; i++) &#160;&#160;&#160;&#160;&#160;&#160;&#160; { &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; result.append(&#34;&#38;#&#34; + (int) b[i] + &#34;;&#34;); &#160;&#160;&#160;&#160;&#160;&#160;&#160; } &#160;&#160;&#160;&#160;&#160;&#160;&#160; return result.toString(); &#160;&#160;&#160; }]]></description>
			<content:encoded><![CDATA[<p class='fp'>我说的中文乱码不是全部是乱码，而是部分是乱码，例如海明威主题里面默认的那个single.php页面里面包含edit this entry的链接，我修改为中文不行，变成乱码了，但是其它的中文都没有问题，原因不明。一个解决的方法就是把中文换成HTML的转义格式，也就是&amp;#加上一个数字并加一个分号的格式。<br />
<span id="more-54"></span> 但是如何得到汉字对应的那个字符串呢？呵呵，很简单，那个数字就是汉字的Unicode的值，下面的这个Java方法就可以转换，网上我找到过一个对应表，但是中文显示不出来，暂时就用这个方法了：<br />
&nbsp;&nbsp;&nbsp; public static String convertToHTMLEscapeFormat(String original)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char b[] = original.toCharArray();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringBuffer result = new StringBuffer();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; b.length; i++)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result.append(&quot;&amp;#&quot; + (int) b[i] + &quot;;&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return result.toString();<br />
&nbsp;&nbsp;&nbsp; }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiehoo.me/resolve-php-mess-up.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>抵御不了增加更多插件的诱惑</title>
		<link>http://www.jiehoo.me/want-more-plugins.htm</link>
		<comments>http://www.jiehoo.me/want-more-plugins.htm#comments</comments>
		<pubDate>Wed, 25 Oct 2006 07:59:28 +0000</pubDate>
		<dc:creator>Cherami</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[杂感]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.jiehoo.com/%e6%8a%b5%e5%be%a1%e4%b8%8d%e4%ba%86%e5%a2%9e%e5%8a%a0%e6%9b%b4%e5%a4%9a%e6%8f%92%e4%bb%b6%e7%9a%84%e8%af%b1%e6%83%91.htm</guid>
		<description><![CDATA[由于使用了WordPress，而它又有那么多的不同插件，看了别人使用的插件列表，有些插件确实很好用，就想着不断的学习别人装了哪些插件，我可以使用哪些。到目前为止才装了7个左右的插件，但是应该会装20个左右吧，有些个性化和增强功能的插件还是很必要的。 这几天整这些插件，发现搞软件的有一个好处，就是即使你不会使用某种语言，但是做一些简单的修改还是很简单的，例如我以前从来没有接触过PHP，但是这几天下来，改了不少东西，也没有遇到太多的问题，简单的看了下语法，其实和JSP也差不多的。]]></description>
			<content:encoded><![CDATA[<p class='fp'>由于使用了WordPress，而它又有那么多的不同插件，<a href="http://www.wordpresscn.com/571">看了别人使用的插件列表</a>，有些插件确实很好用，就想着不断的学习别人装了哪些插件，我可以使用哪些。到目前为止才装了7个左右的插件，但是应该会装20个左右吧，有些个性化和增强功能的插件还是很必要的。</p>
<p>这几天整这些插件，发现搞软件的有一个好处，就是即使你不会使用某种语言，但是做一些简单的修改还是很简单的，例如我以前从来没有接触过PHP，但是这几天下来，改了不少东西，也没有遇到太多的问题，简单的看了下语法，其实和JSP也差不多的。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiehoo.me/want-more-plugins.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
