|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Data Structures | |
| class | xml_format_exception |
Namespaces | |
| namespace | core |
Functions | |
| xmlize ($data, $whitespace=1, $encoding= 'UTF-8', $reporterrors=false) | |
| xml_depth ($vals, &$i) | |
| traverse_xmlize ($array, $arrName= 'array', $level=0) | |
| traverse_xmlize | ( | $ | array, |
| $ | arrName = 'array', |
||
| $ | level = 0 |
||
| ) |
This helps you understand the structure of the array xmlize() outputs
Function by acebone@f2s.com, a HUGE help!
Usage:
traverse_xmlize($xml, 'xml_'); print '
' . implode("", $traverse_array . '';
| array | $array | ? |
| string | $arrName | ? |
| int | $level | ? |
Definition at line 214 of file xmlize.php.
| xml_depth | ( | $ | vals, |
| &$ | i | ||
| ) |
| xmlize | ( | $ | data, |
| $ | whitespace = 1, |
||
| $ | encoding = 'UTF-8', |
||
| $ | reporterrors = false |
||
| ) |
Create an array structure from an XML string.
Usage:
$xml = xmlize($array); See the function traverse_xmlize() for information about the structure of the array, it's much easier to explain by showing you. Be aware that the array is somewhat tricky. I use xmlize all the time, but still need to use traverse_xmlize() quite often to show me the structure!
THIS IS A PHP 5 VERSION:
This modified version basically has a new optional parameter to specify an OUTPUT encoding. If not specified, it defaults to UTF-8. I recommend you to read this PHP bug. There you can see how PHP4, PHP5.0.0 and PHP5.0.2 will handle this. http://bugs.php.net/bug.php?id=29711 Ciao, Eloy :-)
| string | $data | The XML source to parse. |
| int | $whitespace | If set to 1 allows the parser to skip "space" characters in xml document. Default is 1 |
| string | $encoding | Specify an OUTPUT encoding. If not specified, it defaults to UTF-8. |
| bool | $reporterrors | if set to true, then a xml_format_exception exception will be thrown if the XML is not well-formed. Otherwise errors are ignored. |
Definition at line 72 of file xmlize.php.

