PHP attributes() Function
PHP SimpleXML Reference Manual
Example
Return the attributes and values of the body element of the XML:
"; } ?>
Run Example »
Definition and Usage
The attributes() function returns the attributes and values of an XML tag.
Syntax
attributes(
ns,is_prefix
);
| Parameters | Description |
|---|---|
| ns | Optional. Specifies the namespace of the attributes to be retrieved. |
| is_prefix | Optional. Specifies a boolean. If ns is a prefix then TRUE, if ns is a URI then FALSE. Default is FALSE. |
Technical Details
| Return Value: | Returns a SimpleXMLElement object on success. |
|---|---|
| PHP Version: | 5.0.1+ |
PHP SimpleXML Reference Manual