Php checks the sizeofcount function of the array length. The php Tutorial detects the array length function sizeofcount. the php function detects the array length by sizeofcount. see a simple example * $ colorlistarray (applered, grassgreen, skyblue, the nigh php Tutorial detects the array length function sizeof count.
The function used to check the length of the array in php is sizeof count. check a simple instance */
$ Colorlist = array ("apple" => "red", "grass" => "green", "sky" => "blue ", "night" => "black", "wall" => "white ");
Echo "array length:". count ($ colorlist); // 5
/*
Count
The count () function calculates the number of units in the array or the number of attributes in the object.
For an array, return the number of its elements. for other values, return 1. If the parameter is a variable but the variable is not defined, 0 is returned. If the mode is set to count_recursive (or 1), the number of elements in the array in the multi-dimensional array is calculated recursively.
Sizeof
Definition and usage
The sizeof () function calculates the number of units in the array or the number of attributes in the object.
Syntax
Sizeof (array, mode) parameter description
Array is required. Specifies the array or object to be counted.
Mode is optional. Specifies the function mode. Possible values:
0-default. Multi-dimensional arrays (arrays in arrays) are not detected ).
1-multi-dimensional array detection.
Note: this parameter is added to php 4.2.
Prompt count sizeof
Note: If the variable is not set or contains an empty array, the function returns 0. You can use the isset () variable to test whether the variable is set.
The limit count function in php detects the length of an array. For more information, see the following simple example: */$ colorlist = array (apple = red, grass = green, sky = blue, nigh...