IXR_Value::isStruct()publicWP 1.0

Checks whether or not the supplied array is a struct or not

Method of the class: IXR_Value{}

No Hooks.

Return

true|false.

Usage

$IXR_Value = new IXR_Value();
$IXR_Value->isStruct( $array );
$array(array) (required)
-

IXR_Value::isStruct() code WP 6.5.2

function isStruct($array)
{
    $expected = 0;
    foreach ($array as $key => $value) {
        if ((string)$key !== (string)$expected) {
            return true;
        }
        $expected++;
    }
    return false;
}