phpѧϰÊղأºPHPÊý×éµÄ×ܽá
Ò»¡¢Ê²Ã´ÊÇÊý×é
Êý×é¾ÍÊÇÒ»×éÊý¾ÝµÄ¼¯ºÏ£¬°ÑһϵÁÐÊý¾Ý×éÖ¯ÆðÀ´£¬ÐγÉÒ»¸ö¿É²Ù×÷µÄÕûÌå¡£Êý×éµÄÿ¸öʵÌ嶼°üº¬Á½Ï¼üºÍÖµ¡£
¶þ¡¢ÉùÃ÷Êý¾Ý
ÔÚPHPÖÐÉùÃ÷Êý×éµÄ·½Ê½Ö÷ÒªÓÐÁ½ÖÖ£ºÒ»ÊÇÓ¦ÓÃarray()º¯ÊýÉùÃ÷Êý×飬һÊÇÖ±½ÓΪÊý×éÔªËظ³Öµ¡£
<1>array()º¯ÊýÉùÃ÷µÄÊý×éµÄ·½Ê½array([mixed...]) ²ÎÊýmixedµÄÓ﷨Ϊkey=>value
È磬<?php
$array=array("1"=>"±à","2"=>"³Ì","3"=>"´Ê","4"=>"µä");
print_r($array);
echo "<br>";
echo $array[1]; //×¢Ò⣺ϱêĬÈÏÊÇ´Ó0¿ªÊ¼
echo $array[2];
echo $array[3];
echo $array[4];
?>
<2>Ö±½ÓΪÊý×éÔªËظ³Öµ¡£Èç¹ûÔÚ´´½¨Êý×éʱ²»ÖªËù´´½¨Êý×éµÄ´óС£¬»òÔÚʵ¼Ê±àд³ÌÐòʱÊý×éµÄ´óС¿ÉÄÜ·¢Éú±ä»¯£¬²ÉÓÃÕâÖÖÊý×é´´½¨µÄ·½·¨½ÏºÃ¡£
È磬<?php
$array[1]="I";
$array[2]="love";
$array[3]="PHP";
print_r($array); //Êä³öËù´´½¨Êý×éµÄ½á¹¹
?>
Èý¡¢Êý×éµÄÀàÐÍ
PHPÖ§³ÖÁ½ÖÖÊý×飺Ë÷ÒýÊý×é(indexed array)ºÍÁªºÏÊý×é(associative array)£¬Ç°ÕßʹÓÃÊý×Ö×÷Ϊ¼ü£¬ºóÕßʹÓÃ×Ö·û´®×÷Ϊ¼ü¡£
ËÄ¡¢Êä³öÊý×é
ÔÚPHPÖжÔÊý×éÔªËØÊä³ö£¬¿ÉÒÔͨ¹ýechoºÍprintÓï¾äÀ´ÊµÏÖ£¬µ«ÕâÖ»ÄܶÔÊý×éÖÐijһԪËؽøÐÐÊä³ö£»Òª½«Êý×é½á¹¹Êä³öÔòҪʹÓÃprint_r()º¯Êý£¬ÆäÓï·¨£ºprint_r(mixed expression),²ÎÊýexpressionΪÆÕͨµÄÕûÐΡ¢×Ö·ûÐÍ»òʵÐͱäÁ¿ÔòÊä³ö¸Ã±äÁ¿±¾Éí£¬Èç¹û¸Ã²ÎÊýΪÊý×飬Ôò°´Ò»¶¨¼üÖµºÍÔªËصÄ˳ÐòÏÔʾ³ö¸ÃÊý×éÖеÄËùÓÐÔªËØ¡£
Îå¡¢Êý×éµÄ¹¹Ôì
һάÊý×飺
µ±Ò»¸öÊý×éµÄÔªËØÊDZäÁ¿Ê±£¬Ôò³ÆÆäΪһάÊý×é¡£
ÉùÃ÷һλÊý×飺 ÀàÐÍ˵Ã÷·û Êý×éÃû[³£Á¿±í´ïʽ]£»
¶þάÊý×飺
µ±Ò»¸öÊý×éµÄÔªËØÊÇÒ»¸öһλÊý×éʱ£¬Ôò³Æ֮Ϊ¶þάÊý×é¡£
È磬<?php
$str = array (
"ÍøÂç±à³ÌÓïÑÔ"=>array ("PHP","JSP","ASP"),
"ÌåÓýÏîÄ¿"=>array ("m"=>"×ãÇò","n"=>"ÀºÇò"));
print_r ( $str) ;
?>
Áù¡¢±éÀúÊý×é
±éÀúÊý×éÖеÄËùÓÐÔªËØÊdz£ÓõÄÒ»ÖÖ²Ù×÷£¬ÔÚ±éÀúµÄ¹ý³ÌÖпÉÒÔÍê³É²éѯ»òÆäËû¹¦ÄÜ¡£ÔÚPHPÖбéÀúÊý×éµÄ·½·¨ÓжàÖÖ£¬ÏÂÃæ½éÉÜ×î³£ÓõÄÁ½ÖÖ·½·¨¡£
<1>ʹÓÃforeach½á¹¹±éÀúÊý×飻
<2>ʹÓÃlist()º¯Êý±éÀúÊý×飬list()º¯Êý½öÄÜÓ
Ïà¹ØÎĵµ£º
PHP 5.3.1·¢²¼ÁË£¡´Ë´Î²¢Ã»ÓÐÔö¼Ó¶àÉÙÐÂÌØÐÔ£¬Ö÷ÒªÊǹ¦ÄܵĸĽøºÍbugµÄÐÞ¸´£º
ÐÂÔöÁËÒ»¸ömax_file_uploads²ÎÊý£¬ÓÃÓÚÏÔʾÿ¸öÇëÇóÉÏ´«ÎļþµÄ¸öÊý
ÐÂÔöÁËÔÙ´¦Àí¹ý³ÌÖеÄÍêÕûÐÔ¼ì²â
ÐÞ¸´ÁË´«µÝtempnam()º¯Êýʱsafe_modeÖеÄÎÊÌâ
ÐÞ¸´ÁË´«µÝposix_mkfifo()ʱopen_basedirÖеÄÎÊÌâ
ÐÞ¸´ÁËsafe_mode_include_dirÖеÄÎ ......
ÀûÓ÷ÉÐÅAPIʵÏÖ¹«Ë¾ÄÚ²¿·¢ËͶÌÐÅ¿ÉÒÔʡϲ»ÉÙÇ®.ÍøÉÏÒ²Óв»ÉÙ·ÉÐÅAPI,µ«¸Ð¾õ²»¿É¿¿,
»¹ÊÇ×Ô¼ºÐ´ÁËÒ»¸ö¼òµ¥µÄAPI.µ÷ÓõØÖ·ÈçÏÂ,²»»á¼Ç¼·ÉÐÅÃÜÂë.
ϲ»¶µÄÅóÓÑ¿ÉÒÔÊÔÊÔ,½áºÏAU3ÓÖдÁ˸öUDF.ÕâÏ·¢¶ÌÐÅ·½±ãºÜ¶àÁË.
http://lab.l4ever.cn/fetion/api/?from=·¢ËÍÊÖ»ú&pw=·ÉÐÅÃÜÂë&to=½ÓÊÕºÅÂë&msg=¶ÌÐÅÄÚÈ ......
index.php(ʵÏÖÊäÈëÑéÖ¤ÂëÒ³Ãæ)´úÂëÈçÏ£º Code´úÂëÈçÏÂ: <html>
<head>
<title>check code</title>
</head>
<body>
<form name=check method=post action=check.php>
<input type=hidden name=init value=1>
ÑéÖ¤ ......
ʲôÊÇSESSION£¿ °´ÕÕWIKIµÄ½âÊÍ£¬SESSIONÊÇ´æÔÚÓÚÁ½¸öͨÐÅÉ豸¼äµÄ½»»¥ÐÅÏ¢£¬ÔÚijһʱ¼ä½¨Á¢£¬¾¹ýÒ»¶¨µÄʱ¼äºóʧЧ¡£³£¼ûµÄSESSIONÓУºTCP SESSION¡¢WEB SESSION£¨HTTP SESSION£©¡¢LOGIN SESSIONµÈ¡£ ¸ù¾ÝOSIÄ£ÐÍÖУ¬»á»°ÊµÏÖµÄλÖò»Í¬£¬SESSIONÖ÷Òª·ÖΪ¼¸ÖÖ£¬Ò»ÖÖÊÇÓ¦Óòã»á»°£¬°üÀ¨WEB SESSION£¨HTTP SESSION£©ºÍtel ......
phpÖÐsessionµÄÓ÷¨
PHPÖеÄsessionĬÈÏÇé¿öÏÂÊÇʹÓÿͻ§¶ËµÄCookie¡£µ±¿Í»§¶ËµÄCookie±»½ûÓÃʱ£¬»á×Ô¶¯Í¨¹ýQuery_StringÀ´´«µÝ¡£
Php´¦Àí»á»°µÄº¯ÊýÒ»¹²ÓÐ11¸ö£¬ÎÒÃÇÏêϸ½éÉÜһϽ«ÒªÓõ½¼¸¸öº¯Êý¡£
1¡¢ session_start
º¯Êý¹¦ÄÜ£º¿ªÊ¼Ò»¸ö»á»°»òÕß·µ»ØÒѾ´æÔڵĻỰ¡£
º¯ÊýÔÐÍ£ºboolean se ......