PHP Tip, using sizeof() or count()

If you need to determine the number of elements in an array, you can use either sizeof() or count():

<?
$foo = array(“one”, “two”, “three”);
echo count($foo); //will output 3
echo sizeof($foo); // will output 3
?>

Comments are closed.