<?php
$a =array(1=>5,5=>8,22,2=>'8',81);
var_dump($a);
echo '<br/>';
echo $a[7];
echo $a[6];
echo $a[3];
?>

输出结果:

array(5) { [1]=> int(5) [5]=> int(8) [6]=> int(22) [2]=> string(1) "8" [7]=> int(81) }
8122
Notice: Undefined offset: 3 in F:\xampp\www\htdocs\1.php on line 7

Related Posts: PHP-$a =array(1=>5,5=>8,22,2=>’8′,81); echo $a[7]; echo $a[6]; echo $a[3];输出结果 :