In this tutorial learn how to get a size an array using the function with count method in php.
TUTORIAL
public static function size($array)
    {
        return count($array);
    }
TUTORIAL
<?php
$array = Array
(
    0 => Array
        (
            'user_id' => 10,
        ),
    2 => Array
        (
            'user_id' => 9,
        ),
    4 => Array
        (
            'user_id' => 8,
        )
);
 function size($array)
    {
        return count($array);
    }
    
echo size($array);
OUTPUT3
No comments:
Post a Comment