PHP count() Function

<?php$

jobs=array(“Developer”,”Engineer”,”Programmer”);

echo count($jobs);
?>

The result of the count() function in the above example, will be 3.

Make Money with PHP!

PHP sizeof() Function

<?php
$jobs=array(“Developer”,”Engineer”,”Programmer”,”Analyst”);
echo sizeof($jobs);
?>

The result of the sizeof() function in the above example, will be 4.

In almost any useful or complex php application, there will likely be a reason to count an array. Since an array is simply a list of items, words, etc., how could this function be useful to you as a php programmer or web developer?

When it comes to earning money, or creating a useful php application in the competitive marketplace, “why” you code, is just as important, as “how” you code.