Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚ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µã»÷ÏÂÔØtxtÎļþ

ÓÉÓÚÏÖÔÚµÄä¯ÀÀÆ÷ÒѾ­¿ÉÒÔʶ±ð¸ñʽΪtxtµÄÎĵµ¸ñʽ£¬ËùÒÔÈç¹ûÖ»ÊǸøtxtÎĵµ×öÒ»¸öÎÄ×ÖÁ´½ÓµÄ»°£¬¿ÉÄÜÖ»ÊÇ´ò¿ªÒ»¸öд°¿ÚÏÔʾtxtÎļþµÄÄÚÈÝ£¬²¢²»ÄÜʵÏÖµã»÷ÏÂÔصÄÄ¿µÄ¡£We have to do something else.
    µ±È»Õâ¸öÎÊÌâµÄ½â¾ö°ì·¨Ò²¿ÉÒÔÊÇÄ㽫ÄãµÄtxtÎļþ¸ÄÃûΪä¯ÀÀÆ÷²»ÈÏʶµÄÎļþ£¬±ÈÈçrar,ÕâÑùµÄ»°µã»÷£¬ ......

PHPÄ£°å

<!--<?php
     <!--
EOT;
if($yy_en_lang==1){
echo <<<EOT
-->
<a href="$index_e_url">English</a>
<!--
EOT;
}
echo <<<EOT
-->
?>
ÕâÊÇÒ»¶ÎSmartyÄ£°å´úÂ룬¿ÉÊÇÎÒ¿´²»¶®Õâ¸ö¹æÔòÇë¸ßÊÖÖ¸µãһϰ¡£¡£¡Ð»Ð»!
»òÕß ......

php config

php config
1.°²×°Apache2.2
2.°²×°php5.2(×¢ÒâÑ¡ÔñËùÓеĿâÎļþ)
3.½«phpMyAdmin½âѹ£¬¿½±´ÖÁApache2.2\htdocs\phpmyadmin(¸Ã·¾¶¿ÉÒÔ×ÔÓɸıä)Ï¡£
4.ÐÞ¸ÄÅäÖÃÎļþ£º
 1)ÐÞ¸Äphp.ini
  ¾ßÌå²Ù×÷£º
  extension_dir = "C:\Program Files\PHP\ext"  (536)
  extension=php ......

linuxÏÂÖ´ÐÐphpÎļþ·¢ÏÖCould not open input file

ÔÚlinuxÏÂͨ¹ýsvn¸üÐÂÁËÒ»¸öphpÎļþ£¬Ä¿µÄÊÇÏëͨ¹ýÖ´ÐÐÕâ¸öÎļþÀ´¶ÁÊý¾Ý²åÈëµ½Êý¾Ý¿â¡£ÔÚÆäÖеļ¸Ì¨Ö´ÐÐûÓÐÎÊÌ⣬ÆäÖÐһ̨¾Í·¢ÏÖÁËCould not open input fileÕâ¸ö´íÎ󣬺óÀ´²éÕÒ×ÊÁϲŷ¢ÏÖÔ­À´ÊÇÎļþ¸ñʽµÄÎÊÌ⣬³ö´íʱÎļþ¸ñʽÊÇdos£¬¿ÉÒÔÔÚviÖÐÓÃ:set ffÀ´²é¿´£¬Èç¹ûÊÇdos¸ñʽ£¬ÄÇôÔòÓÃ:set ff=unixÀ´ÉèÖÃеĸñʽ£¬ÕâÑ ......

php ÉÏ´«Îļþ

//×îºÃÏȽ¨Á¢Ò»¸ö upload/publicÕâ¸öÎļþ¼Ð£¬ÒÔÏÂÊÇupload.php
<?php
/**
*********************************************
²ÎÊýÉ趨
*********************************************
**/
//×î´óÉÏ´«Îļþ´óС
$MAX_SIZE = 20000000;
//ÉèÖÃMineÀàÐÍ
$FILE_MIMES = array
('image/jpeg','image/jpg','image/gif ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ