<?php
$a[]="one";
$a[]="two";
$a[]="three";
$num=count($a);
echo "The number of the array is:".$num.'<br>';
foreach($a as $key=>$value){
echo $value."<br>";
}
?>
通過上述代碼執行結果爲:
The number of the array is:3
one
two
three
<?php
$a[]="one";
$a[]="two";
$a[]="three";
$num=count($a);
echo "The number of the array is:".$num.'<br>';
foreach($a as $key=>$value){
echo $value."<br>";
}
?>
通過上述代碼執行結果爲:
The number of the array is:3
one
two
three