IXR_Value::isStruct()publicWP 1.0

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

{} It's a method of the class: IXR_Value{}

No Hooks.

Return

true|false.

Usage

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

Code of IXR_Value::isStruct() WP 6.0

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