public static function getAttribute(\SimpleXMLElement $xml, $attr, $default = null)
    {
        if (!isset($xml[$attr])) {
            return $default;
        }

        return (string) $xml[$attr];
    }
public static function getAttribute(\SimpleXMLElement $xml, $attr, $default = null)
    {
        if (!isset($xml[$attr])) {
            return $default;
        }

        return (string) $xml[$attr];
    }
public static function getAttribute ( \ SimpleXMLElement $ xml , $ attr , $ default = null ) { if ( ! isset ( $ xml [ $ attr ] ) ) { return $ default ; } return ( string ) $ xml [ $ attr ] ; }
Get attribute from SimpleXMLElement.

@param \SimpleXMLElement $xml     A SimpleXMLElement object.
@param string            $attr    The attribute name.
@param mixed             $default The default value.

@return mixed The return value of this attribute.
Get attribute from SimpleXMLElement .