|
|
|
|
|
|
Function mioxml_getElement | Language: PHP
|
Syntax
| mioxml_getElement(XML, HTML_TAG, HTML_ATTR) |
Parameters
| STRING | XML | XML data to search in
| | STRING | HTML_TAG | HTML tag to retrieve
| | STRING | HTML_ATTR | Optional. HTML attribute |
Return value
Description
Search the first tag in the specified XML document and returns a value.
If the third parameter HTML_ATTR is set, the function returns the value of this parameter for the first tag specified.
Otherwise, the content of the tag is returned. |
PHP Sample Code
// In this sample, we have an XML file as follow:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<DATA>
<VERSION>1</VERSION>
</DATA>
// PHP code to retrieve the content of the tag VERSION
$x = disk_file_load('myFile.xml');
$ver = mioxml_getElement($x, "VERSION");
echo($ver);
|
|
|
|