How to get array size of the php.Simply php count() and sizeof() functions get array size.
1 2 3 4 5 6 7 8 |
$myArray = array(0 => 'user_id', 1 => 'user_name', 2 => 'user_email'); $arraySize1 = sizeof($myArray); echo 'Array size using sizeof() function:'.$arraySize1; echo '<br/>'; $arraySize2 = count($myArray); echo 'Array size using count() function:'.$arraySize2; |