<?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>Dream☆Wing &#187; PHP</title>
	<atom:link href="http://www.dreamwing.org/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dreamwing.org</link>
	<description></description>
	<lastBuildDate>Tue, 06 Jul 2010 03:56:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP version 5.3.0 is released</title>
		<link>http://www.dreamwing.org/anything/php-version-530-is-released.html</link>
		<comments>http://www.dreamwing.org/anything/php-version-530-is-released.html#comments</comments>
		<pubDate>Tue, 30 Jun 2009 14:19:20 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[Anything]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/anything/php-version-530-is-released.html</guid>
		<description><![CDATA[The PHP development team is proud to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes.
The key features of PHP 5.3.0 include:

Support for namespaces
Late static binding
Lambda Functions and Closures
 Syntax additions:    NOWDOC,  [...]]]></description>
		<wfw:commentRss>http://www.dreamwing.org/anything/php-version-530-is-released.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php syntax exam</title>
		<link>http://www.dreamwing.org/php/php_syntax_exam.html</link>
		<comments>http://www.dreamwing.org/php/php_syntax_exam.html#comments</comments>
		<pubDate>Tue, 03 Mar 2009 07:56:25 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=561</guid>
		<description><![CDATA[http://www.blueshoes.org/en/developer/syntax_exam/
在php手册中看到类型比较的时候发现的这个exam，正好测试了下基础，错了几个记录下来
21.  $x = (array(&#8217;a'=&#62;&#8217;foo&#8217;) == array(&#8217;b'=&#62;&#8217;foo&#8217;));
what is $x?
you said: TRUE
right is: FALSE
好吧，我以为这两个数组比较时值都是ARRAY的说，其实两个数组在比较时并不是转换成字符进行比较的
 array与array的比较，具有较少成员的数组较小，如果运算数 1 中的键不存在于运算数 2 中则数组无法比较，否则挨个值比较
22.$arrOne = array(&#8221;=&#62;&#8221;);
$arrTwo = array(&#8217;9&#8242;=&#62;&#8217;apple&#8217;, &#8216;15&#8242;=&#62;&#8217;banana&#8217;, &#8216;20&#8242;=&#62;&#8217;grapefruit&#8217;);
$x = array_merge($arrOne, $arrTwo);
what is $x?
1) array(&#8221;=&#62;&#8221;, 0=&#62;&#8217;apple&#8217;, 1=&#62;&#8217;banana&#8217;, 2=&#62;&#8217;grapefruit&#8217;);
2) array(&#8221;=&#62;&#8221;, 9=&#62;&#8217;apple&#8217;, 15=&#62;&#8217;banana&#8217;, 20=&#62;&#8217;grapefruit&#8217;);
you said: 2
right is: 1
具体见array_merge函数
如果只给了一个数组并且该数组是数字索引的，则键名会以连续方式重新索引。
如果你想完全保留原有数组并只想新的数组附加到后面，用 + 运算符。 
50.  $x = (bool)(&#8221;hello&#8221; == TRUE);
what is $x?
you said: FALSE
right is: [...]]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/php_syntax_exam.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash与PHP交互时不同系统的UA不同</title>
		<link>http://www.dreamwing.org/php/flash_php_different_system_useragent.html</link>
		<comments>http://www.dreamwing.org/php/flash_php_different_system_useragent.html#comments</comments>
		<pubDate>Thu, 26 Feb 2009 09:59:16 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=540</guid>
		<description><![CDATA[在mac下是Adobe Flash Player
在windows下是shockwave之类
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/flash_php_different_system_useragent.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>amfphp之php</title>
		<link>http://www.dreamwing.org/php/amfphp_notes.html</link>
		<comments>http://www.dreamwing.org/php/amfphp_notes.html#comments</comments>
		<pubDate>Wed, 17 Dec 2008 09:13:32 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=456</guid>
		<description><![CDATA[http://www.amfphp.org/
1.php接口文件名必须和类名相同
例如：paint.php中的类必须用class paint{&#8230;}
2.php接口文件放置在amfphp/services/下即可通过Flex调用
PS:可以在amfphp/browser/index.html调试接口
PPS:可以在globals.php更改$servicesPath
3.如果接口返回中文字符的话，需要在amfphp/gateway.php的line127 设置对应的字符串编码
例如：$gateway-&#62;setCharsetHandler(&#8221;utf8_decode&#8221;, &#8220;UTF-8&#8243;, &#8220;UTF-8&#8243;);
4.php接口中全局变量的问题（连续2次问题都因此）
amfphp在调用php接口时是把这个接口文件include到amfphp本身的类里，所以include的时候就会出现在函数里global声明的变量获取不到，需要改成在声明该全局变量时就声明该变量global
详见http://cn2.php.net/manual/en/language.variables.scope.php#63500
5.如果加载大数据失败的话，可以调整amfphp/gateway.php的line151，把20调的更大些
比如$gateway-&#62;enableGzipCompression(200*1024);
6.gateway类的service方法会输出自己的header，如果对应的services也输出header信息的话可能会在ie7下报错。(bug#1076)
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/amfphp_notes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用serialize后的值做mc的key时要注意数组值的类型</title>
		<link>http://www.dreamwing.org/php/watch_the_key_of_array_after_serialize.html</link>
		<comments>http://www.dreamwing.org/php/watch_the_key_of_array_after_serialize.html#comments</comments>
		<pubDate>Wed, 10 Dec 2008 16:31:36 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=444</guid>
		<description><![CDATA[$filter_i = array(&#8217;itemid&#8217;=&#62;1);
$filter_s = array(&#8217;itemid&#8217;=&#62;&#8217;1&#8242;);
这两个serialize后的值肯定不一样恩，一个是s，一个是i
所以$key = &#8216;get_attach_&#8217; . md5(serialize($filter));的话会有可能出现虽然查询的是同一数据，但实际上做了2次缓存
对应的清理缓存时也有可能清理的对象是另外一个
所以大家都$filter['itemid'] = intval($filter['itemid'])一下好了
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/watch_the_key_of_array_after_serialize.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP也可以开发IM</title>
		<link>http://www.dreamwing.org/php/jecat_jabber_im_on_php.html</link>
		<comments>http://www.dreamwing.org/php/jecat_jabber_im_on_php.html#comments</comments>
		<pubDate>Fri, 17 Oct 2008 19:29:28 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[IM]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=322</guid>
		<description><![CDATA[偶然发现JeCat-Jabber，用PHP开发的IM，开源的，赞！
目前版本还只是0.1.1，14号刚发布的，严重关注！
刚试了一下，目前支持的功能也很有限，当然，最主要的聊天功能是实现了，这就很好了，其他扩展可以慢慢来
咱也可以研究研究，哈哈，虽然不可与QQ，MSN，GTALK等同日而语，不过看到能用PHP开发IM真的很开心
谁说PHP只能做WEB的哈哈哈哈
上地址：http://jj.jecat.cn/
上介绍：
JeCat-Jabber PHP开源即时通讯软件V0.1.1

下载：http://down.chinaz.com/soft/24024.htm
JeCat-Jabber(简称：JJ)  是一款完全由 PHP 开发的即时通讯软件。JJ 采用 Gtk2 图像界面库来实现用户界面。顾名思义 JJ 使用 Jabber 协议(XMPP) ，因此可以 和 包括  GTalk 在内的 其它任何 XMPP 即时通讯软件 聊天。
JJ 项目的初衷在于 演示 桌面窗口 和 PHP 多任务处理，这两大 在长期在 PHP程序员 眼中 几乎是“不可能”的任务。 同时 也是 PHP框架 JCAT 的演示项目，JCAT 是一款同时 支持 Web 和 桌面 的 PHP框架，按照计划 将在稍后 发布。
JJ 的特点
&#62; 跨平台。JJ 在Linxu 环境下 开发，在 Windows 平台上也一样可以正常使用。
&#62; 实用 标准的 XMPP协议，能够与其它的 Jabber 软件互相通讯，例如 [...]]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/jecat_jabber_im_on_php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dips4:关于整型integer遇到的进制和溢出的问题</title>
		<link>http://www.dreamwing.org/php/dips_overflow_and_octal_of_integer.html</link>
		<comments>http://www.dreamwing.org/php/dips_overflow_and_octal_of_integer.html#comments</comments>
		<pubDate>Sun, 12 Oct 2008 15:50:43 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Dips]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=283</guid>
		<description><![CDATA[
$v = 04555720201;
echo $v;

恩。。。。输出结果是632791169
起初以为是溢出的，最后发现是因为以0开头的整型会被认为八进制。
查了点资料做备份。
1.Syntax:
Integers can be specified in decimal (base 10), hexadecimal (base 16), or octal (base  notation, optionally preceded by a sign (- or +).
To use octal notation, precede the number with a 0 (zero). To use hexadecimal notation precede the number with 0x.
decimal     : [1-9][0-9]*
    [...]]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/dips_overflow_and_octal_of_integer.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 775920 bytes)</title>
		<link>http://www.dreamwing.org/php/fatal_error_allow_memory_size_exhausted.html</link>
		<comments>http://www.dreamwing.org/php/fatal_error_allow_memory_size_exhausted.html#comments</comments>
		<pubDate>Wed, 17 Sep 2008 14:17:04 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=222</guid>
		<description><![CDATA[解决办法（三种）：
一、修改php.ini（推荐）
memory_limit = 12M
二、在程序里面添加如下语句
ini_set('memory_limit', '12M');
三、在根目录建立.htaccess文件，添加如下内容
php_value memory_limit 12M
如果还不能解决，就把它改得再大一些。
最后注意的是重启服务器。
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/fatal_error_allow_memory_size_exhausted.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>array_map()+create_function()</title>
		<link>http://www.dreamwing.org/php/array_map_plus_create_function.html</link>
		<comments>http://www.dreamwing.org/php/array_map_plus_create_function.html#comments</comments>
		<pubDate>Wed, 27 Aug 2008 18:10:55 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=119</guid>
		<description><![CDATA[在查询数据时习惯用SELECT *把所有数据都取出来扔到一个二维数组里
这样一来如果要取数据中具体某个值组成的数组的话一般是foreach出来扔到一个新数组里
例如数组$userarr = array(
array(&#8217;uid&#8217;=>1,&#8217;username&#8217;='dreamwing&#8217;),
array(&#8217;uid&#8217;=>2,&#8217;username&#8217;='cherry&#8217;)
);
要取得uid的集合的话，一般是foreach出来扔到一个新数组里。
写多了就回想有没其他方法来实现，数组的函数还是很多的
其中array_map()函数可以用回调函数处理数组的单元

这样
function return_uid($user)
{
return $user['uid'];
}
$uidarr = array_map(&#8217;return_uid&#8217;,$userarr);
即可
当然，与foreach相比，哪种写法效率高有时间再测试下
不过，如果可以像JQuery那样在第一个$param里定义函数多美&#8230;..
既然用都用了，那么多了解点array_map()这个函数吧
官网有几个例子：
1.同上
2.函数有N个参数，array_map()可以传N个数组.The number of parameters that the callback  function accepts should match the number of arrays passed to the array_map()
3.有点意思的使用方式，当回调函数$callback为null时，就回构造出一个数组的数组（传一个数组进去则返回相等的数组，传多个数组的话则返回1二维数组，以每个数组的同一键值组成的数组作为其的一个值）
4.如果传入的数组包含字符串键名时(associative)，当且仅当只传入一个数组时，返回的数组也会包含对应的字符串键名；如果传入多个数组的话，则永远是数字键名（XX数组？）
在官网有人举了个例子，用到了create_function()函数，借过来可以这样
$callback = create_function(&#8217;$uarr&#8217;,'return $uarr[\'uid\'];&#8217;);
$uidarr = array_map($callback,$userarr);
注：1.create_function()生成一匿名的函数(lambda?-style)，返回函数名或者FALSE
2.一般参数用单引号以达到不解析变量的目的
当然，用array_map()来处理一些问题还是很方便的，比如搜索结果关键词高亮等等，再适当配合下create_function()就更简洁了
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/php/array_map_plus_create_function.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dips1:JS中获得PHP json_encode后的数据处理</title>
		<link>http://www.dreamwing.org/javascript/dips_eval_func.html</link>
		<comments>http://www.dreamwing.org/javascript/dips_eval_func.html#comments</comments>
		<pubDate>Thu, 21 Aug 2008 19:17:34 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Dips]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=97</guid>
		<description><![CDATA[一个通过AJAX来实现二级联动的东西，PHP获取数组以json的形式返回给JS
这里有个小地方需要注意，PHP中json_encode函数return的结果是string的形式
所以传到JS后还需要通过eval()函数来以JS代码形式执行这段string
PS：与JS交互还是JSON比XML方便吖XD

function setbaby(classid,babyid){
	var class_id = document.getElementById(classid).value;
	var x = new Ajax('statusid', 'HTML');
	x.get('batch.common.php?action=getbaby&#038;classid='+class_id, function(s){
		var babyOptions = new Array();
		var babyOptions = eval(s);
		var babyObject = document.getElementById(babyid);
		babyObject.options.length = 0;
		babyObject.options[0] = new Option("选择宝宝","");
		var j=0;
		for(var i=0;i]]></description>
		<wfw:commentRss>http://www.dreamwing.org/javascript/dips_eval_func.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
