public static function getAttributeValue($nodeString, $attributeName)
    {
        $attributeName = '[@' . $attributeName . '="';
        $positionOfAttributeName = strpos($nodeString, $attributeName);

        if ($positionOfAttributeName === false) {
            return false;
        }

        $positionOfAttributeValue = $positionOfAttributeName + strlen($attributeName);
        return substr($nodeString, $positionOfAttributeValue, strpos($nodeString, '"]', $positionOfAttributeValue) - $positionOfAttributeValue);
    }
public static function getAttributeValue($nodeString, $attributeName)
    {
        $attributeName = '[@' . $attributeName . '="';
        $positionOfAttributeName = strpos($nodeString, $attributeName);

        if ($positionOfAttributeName === false) {
            return false;
        }

        $positionOfAttributeValue = $positionOfAttributeName + strlen($attributeName);
        return substr($nodeString, $positionOfAttributeValue, strpos($nodeString, '"]', $positionOfAttributeValue) - $positionOfAttributeValue);
    }
public static function getAttributeValue ( $ nodeString , $ attributeName ) { $ attributeName = '[@' . $ attributeName . '="' ; $ positionOfAttributeName = strpos ( $ nodeString , $ attributeName ) ; if ( $ positionOfAttributeName === false ) { return false ; } $ positionOfAttributeValue = $ positionOfAttributeName + strlen ( $ attributeName ) ; return substr ( $ nodeString , $ positionOfAttributeValue , strpos ( $ nodeString , '"]' , $ positionOfAttributeValue ) - $ positionOfAttributeValue ) ; }
Parses the node string and returns a value of attribute for name provided.

An internal representation of CLDR data used by this class is a simple
multi dimensional array where keys are nodes' names. If node has attributes,
they are all stored as one string (e.g. 'calendar[@type="gregorian"]' or
'calendar[@type="gregorian"][@alt="proposed-x1001"').

This convenient method extracts a value of desired attribute by its name
(in example above, in order to get the value 'gregorian', 'type' should
be passed as the second parameter to this method).

Note: this method does not validate the input!

@param string $nodeString A node key to parse
@param string $attributeName Name of the attribute to find
@return mixed Value of desired attribute, or false if there is no such attribute
Parses the node string and returns a value of attribute for name provided .