Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | PHP | LIB_MIO_WLIB_PHP | mioxml_getElement SEARCH    

  Functions
comma
copy
count
disk_file_list
disk_file_load
disk_file_save
disk_folder_copy
disk_folder_list
disk_folder_remove
explode
get_baseURL
get_currentPath
implode
mioDb_connect
mioDb_query
mioxml_getElement
mioxml_getElementArray
mioxml_getOuter
settingsSetSimpleValue
settingsStringToArray
settingsToArray
strlen
strpos
strrpos
strtolower
strtotime
strtoupper
str_decrypt
str_encrypt
str_posEx
str_replace
str_split
substr

  Libraries
miodb_lib.php
mio_wlib.php
stats_read.php
stats_write.php

Function
mioxml_getElement

Language: PHP


Syntax

mioxml_getElement(XML, HTML_TAG, HTML_ATTR)


Parameters

STRINGXMLXML data to search in
STRINGHTML_TAGHTML tag to retrieve
STRINGHTML_ATTROptional.
HTML attribute


Return value

String



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);