配列の数を出力する

count() 関数を使い、設定されている配列の数を出力することができます。

<?php

$ary = array("aa","bb","cc");

echo count($ary);

?>

 

[対象]
PHP 5.x