How to use count funtion for array in php


Count function is used for array  in which we can found out how many elements are there in the array and by that way we can do as many operations as we want to do . We can easily show the count of the array.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ARRAY COUNT FUNCTION Examples in PHP</title>

//We can define blank array by this way
$my_array = array();

//We can add values in array by this way
$my_array = array("A","B","C","D");

echo 'Array Counter- -'.count($my_array);
//The Result will be 4