??? ??
PHP ??? ??
? ??? ?? ?? ??? ? ??, ?? ??? ?? ??? ? ????. ?? ???? 2?? ?? 3?? ??? ??? ? ????:
Instance
<?php // 二維數(shù)組: $cars = array ( array("Volvo",100,96), array("BMW",60,59), array("Toyota",110,100) ); ?>
PHP - MultiDimensional Array
??? ?? ?? ?? ??? ??? ?????.
??? ???? ?? ??? ? ??? ??? ? ?? ?? ?? ??? ? ??? ??? ? ?? ????.
?
? ???? ID ?? ???? ??? ??? ??? ????.
?
<?php $sites = array ( "php"=>array ( "php中文網(wǎng)", "http://ipnx.cn" ), "google"=>array ( "Google 搜索", "http://www.google.com" ), "taobao"=>array ( "淘寶", "http://www.taobao.com" ) ); print("<pre>"); // 格式化輸出數(shù)組 print_r($sites); print("</pre>"); ?>
? ??? ??? ?? ?????. :
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?> ?? ??
??? ??? ?? ??? ??? ???? ??? ????.
1. 1?? ?? ???? ?? ??? ?? ?? ??? ??? ?? ????.
2. 2?? ?? ??? ?? ??? ?? ?? ?? ??? ?????.
3. 3?? ??? ??(B)? ??(B)? ?????. A) ? ?? ??? ??(C)? B ??? ?????, ?? 3?? ????? ???4. 3?? ??? ??? ??? ????? ???.
??? ?? ??? ???:
??? ???? ? ??? ???? ????? ?????. ???? ?? ?? ????.
【?????】
?? ?? ??? ?? ??? ?????. ??? ??? ??? ? ?? ????(;)? ?? ???.