,

PHP – Reliable Array Size

Code:

function size($array) {
    if (isset($array) && is_array($array)) {
        return sizeof($array);
    }
    return 0;
}

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *