IXR_Value::isStruct() WordPress Method

The IXR_Value::isStruct() method is used to check if an IXR_Value object contains a struct. A struct is a collection of values, each with a name.

IXR_Value::isStruct( array $array ) #

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


Parameters

$array

(array)(Required)


Top ↑

Return

(bool)


Top ↑

Source

File: wp-includes/IXR/class-IXR-value.php

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

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.