ÔÚPHPÖбéÀúÊý×éÔªËØ
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/20100411/56.html
ÔÚPHPÖÐʹÓÃforeachº¯Êý¿ÉÒÔ±éÀúÊý×é¡£Foreach½öÄÜÓÃÓÚÊý×飬Óï·¨ÈçÏ£º
Foreach(array as $value) statements
Foreach(array as $key=>$value) statement
µÚÒ»ÖÖÓï·¨±éÀúÊý×éʱ£¬Ã¿´ÎÑ»·Ê±£¬µ±Ç°µ¥ÔªµÄÖµ±»¸³¸ø$value£¬Êý×éÄÚ²¿µÄÖ¸ÕëÏòÇ°ÒÆһλ¡£
ÀýÈ磺
<?php
$php = array(0=>”php”,1=>”phpdo”,2=>”www.phpdo.net”);
foreach($php as $value)
{
echo “value:$value;”;
}
echo “<BR>”;
//µÚ¶þÖÖÓï·¨±éÀúʱ£¬ÔÚÿ´ÎÑ»·Ê±£¬¼üÖµ»á±»¸³Öµ¸ø±äÁ¿key.
foreach($php as $key=>$value)
{
echo “key:$key;value:$value”;
}
?>
½á¹û£º
value:php;value:phpdo;value:www.phpdo.net;
key:0;value:phpkey:1;value:phpdokey:2;value:www.phpdo.net
¶ÔÓÚ¶àάÊý×éÈç¿ÉʹÓÃÄØ£¿
û´í¡£ÄúÒ»¶¨Ïëµ½ÁË°É£¿
ÀýÈ磺
<?php
$php = array(“php1″=>array(0=>”php”,1=>”phpdo”),”php2″=>array(0=>”phpdo.net”,1=>”www.phpdo.net”));
foreach($php as $value1)
{
foreach($value1 as $value2)
{
echo “$value2\n”;
}
}
?>
½á¹û£º
php phpdo phpdo.net www.phpdo.net
Ïà¹ØÎĵµ£º
<!--<?php
<!--
EOT;
if($yy_en_lang==1){
echo <<<EOT
-->
<a href="$index_e_url">English</a>
<!--
EOT;
}
echo <<<EOT
-->
?>
ÕâÊÇÒ»¶ÎSmartyÄ£°å´úÂ룬¿ÉÊÇÎÒ¿´²»¶®Õâ¸ö¹æÔòÇë¸ßÊÖÖ¸µãһϰ¡£¡£¡Ð»Ð»!
»òÕß ......
http://blog.developers.api.sina.com.cn/?p=264
×î½üMemcacheDBÓʼþÁбíºÍÑз¢²¿ÄDZßͬʱ¨¸æPHPµÄmemcache¿Í»§¶Ëphp-memcache¾³£³ö ÏÖ¶ÏÁ¬½ÓµÄÎÊÌ⣺
PHP Notice: Memcache::get(): Server ………. (tcp 11211) failed with: Failed reading line from stream (0) with pecl-memcache 3.*
&h ......
mb_convert_encodingÕâ¸öº¯ÊýÊÇÓÃÀ´×ª»»±àÂëµÄ¡£ÔÀ´Ò»Ö±¶Ô³ÌÐò±àÂëÕâÒ»¸ÅÄî²»Àí½â£¬²»¹ýÏÖÔÚºÃÏñÓе㿪ÇÏÁË¡£
²»¹ýÓ¢ÎÄÒ»°ã²»»á´æÔÚ±àÂëÎÊÌ⣬ֻÓÐÖÐÎÄÊý¾Ý²Å»áÓÐÕâ¸öÎÊÌâ¡£±ÈÈçÄãÓÃZend Studio»òEditplusд³ÌÐòʱ£¬ÓõÄÊÇgbk±àÂ룬Èç¹ûÊý¾ÝÐèÒªÈëÊý¾Ý¿â£¬¶øÊý¾Ý¿âµÄ±àÂëΪutf8ʱ£¬Õâʱ¾ÍÒª°ÑÊý¾Ý½øÐбàÂëת»»£¬²»È»½øµ½Ê ......
[php]
<?php
--------------------------------------------------------------------
//FileName:class.php
//Summary: AccessÊý¾Ý¿â²Ù×÷Àà
//Author: forest
//CreateTime: 2006-8-10
//LastModifed:
//copyright (c)2006
//http://freeweb.nyist.net/~chairy
//cha ......
1£º apache·þÎñÆ÷°²×°.apache_2.0.59-win32-x86-no_ssl.msi¡£
ÐÞ¸Äconf\httpd.confÖеÄÎļþ£¬ÐÞ¸ÄλÖÃΪ£º
DocumentRoot "c:/webpage" ÉèÖÃÐéÄâĿ¼ c:/webpage.
DirectoryIndex index.html index.html.var index.php
==ʹapache·þÎñÆ÷ʶ±ðphpµÄÀ©Õ¹Ãû¡£
ÔÚ<Directory "c:/pr ......