PHP µÄÒýÓñäÁ¿ÎÊÌâ
$xml = '../data/news.xml' ;
$qp = qp($xml, 'news_root')->children();
$arrData = array() ;
$i = 0 ;
foreach( $qp as $child )
{
print_r( $arrData );
echo "<br/>hi<br/>";
unset($arrSub);
$arrSub = array() ;
array_push( $arrData , &$arrSub );
print_r( $arrData );
echo "<br/>";
// $arrData[] = &$arrSub;
$child = $child->children() ;
foreach( $child as $item )
{
$arrSub[ $item->tag() ] = $item->text();
}
print_r( $arrData );
echo"<br/>";
}
ÉÏÃæµÄ´úÂë,×¢Òâ unset($arrSub) Õâ¾ä.
Îҵı¾ÒâÊÇ $arrData ½âÎö³öxmlµÄ2²ãÄÚÈÝ.
ÎÒÓÃarray_pushѹÈëÒ»¸öÒýÓõÄÊý×é arrSub ,
È»ºó²Ù×÷arrSub,µÈÓÚÐÞ¸ÄarrData.
µ«ÊÇ,ÕâÆäʵÊÇÓÐÎÊÌâµÄ.
ÏÔʾarrData×îºóµÄÄÚÈÝÈ«ÊÇ×îºóÒ»ÌõxmlÄÚÈݵĸ´ÖÆ. (ÎÒµÄxml×îºóÊÇ¿ÕÏî,ËùÒÔarrDataÊÇ:[ [],[] ] ,¶ø²»ÊÇÕýÈ·µÄ: [ [data1,data2] , [] ]
µ±ÎÒÓÃÒýÓðÑarrSubѹÈëarrDataºó,
Ò»¸öÑ»·¹ýºó,ÓÖÓöµ½Óï¾ä $arrSub = array() ; Õâ¾ÍÓÐÎÊÌâÁË,Õâ¾ä»°Ö´Ðкó, arrDataÀïÃæµÄÒ»¸öÒ²±ä³ÉÁ˿յÄarray.
ËùÒÔ±ØÐë½â³ýÒýÓà unset( $arrSub ) ¾ÍÄܽâ¾öÎÊÌâ.
Ïà¹ØÎĵµ£º
SESSIONµÄʹÓÃ
SESSIONµÄ×÷Óúܶ࣬×î¶àÓõľÍÊÇÕ¾µãÄÚÒ³Ãæ¼ä±äÁ¿´«µÝ¡£ÔÚÒ³Ãæ¿ªÊ¼ÎÒÃÇÒªsession_start();
¿ªÆôSESSION£»
È»ºó¾Í¿ÉÒÔʹÓÃSESSION±äÁ¿ÁË£¬±ÈÈç˵Ҫ¸³Öµ¾ÍÊÇ£º$_SESSION['item']="item1";ÒªµÃµ½Öµ¾Í
ÊÇ$item1=$_SESSION['item'];£¬ºÜ¼òµ¥°É¡£ÕâÀïÎÒÃÇ¿ÉÄÜ»áʹÓõ½Ò»Ð©º¯Êý£¬±ÈÈç˵ÅжÏÊDz»ÊÇ
ijSESSION±ä ......
memcached±¾µØwindowsϵͳ²âÊÔ
ÓõÄÊÇwindowsϵͳ¡£
1.ÏÂÔØMemcache for win32
ÏÂÔØµØÖ·: http://jehiah.cz/projects/memcached-win32/
Ñ¡Ôñmemcached 1.2.1 for Win32 binaries (Dec 23, 2006) ÊÇexeµÄ³ÌÐò
memcached.exe -d install
memcached -d start
2.ÏÂÔØphp_memcache.dll
ÏÂÔØµØÖ·: http://www.wesoho.com/ ......
REQUEST_URI ·µ»ØµÄÊǰüÀ¨ºóÃæÊý¾Ý´®µÄµØÖ·£¬Èç index.php?str=1234 PHP_SELF ÊÇ index.php
--------------------------------------------------------------------------------
$_SERVER[’PHP_SELF’]ÔÚ¿ª·¢µÄʱºò³£»áÓõ½£¬Ò»°ãÓÃÀ´ÒýÓõ±Ç°ÍøÒ³µØÖ·£¬²¢ÇÒËüÊÇϵͳ×Ô¶¯Éú³ÉµÄÈ«¾Ö±äÁ¿£¬Ò²»áÓÐʲôÎÊÌâô?È ......
ÎÊÌâÒ»£ºcactiÈç·¨Õý³£µÇ¼£¬Ã»Óб¨PHP³ÌÐò´íÎó
½â¾ö¹ý³Ì½â¾ö¹ý³Ì£º¿ªÆôPHP±¨´íÏÔʾ£¨ÔÚµ÷ÊÔʱ£¬Ò»Ö±¿¨ÔÚÕâ¶ù£¬ÓÉÓÚÊÇ·þÎñÆ÷ÉÏ£¬Ã»ÓпªÆô±¨´í³ÌÐò£©display_errors = On
·¢ÏÖ±¨Warning: session_start() [ ......
±¾ÎÄ´Ó http://tech.ddvip.com/2009-02/1235627800109815.html ×°ÔØ,·Ç³£¸Ðл×÷Õß!
MySQL+PHP²úÉúÂÒÂëÔÒò£º
¡¡¡¡¡ô MySQLÊý¾Ý¿âĬÈϵıàÂëÊÇutf8,Èç¹ûÕâÖÖ±àÂëÓëÄãµÄPHPÍøÒ³²»Ò»ÖÂ,¿ÉÄܾͻáÔì³ÉMySQLÂÒÂ룻
¡¡¡¡¡ô MySQLÖд´½¨±íʱ»áÈÃÄãÑ¡ÔñÒ»ÖÖ±àÂë,Èç¹ûÕâÖÖ±àÂëÓëÄãµÄÍøÒ³±àÂë²»Ò»ÖÂ,Ò²¿ÉÄÜÔì³ÉMySQLÂÒÂ룻
¡¡ ......