Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/xmlize.php File Reference

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)

Function Documentation

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 . '

';

Author:
acebone@f2s.com
Parameters:
array$array?
string$arrName?
int$level?
Returns:
int
Todo:
Finish documenting this function

Definition at line 214 of file xmlize.php.

xml_depth ( vals,
&$  i 
)

Definition at line 119 of file xmlize.php.

Here is the caller graph for this function:

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

Parameters:
string$dataThe XML source to parse.
int$whitespaceIf set to 1 allows the parser to skip "space" characters in xml document. Default is 1
string$encodingSpecify an OUTPUT encoding. If not specified, it defaults to UTF-8.
bool$reporterrorsif set to true, then a xml_format_exception exception will be thrown if the XML is not well-formed. Otherwise errors are ignored.
Returns:
array representation of the parsed XML.

Definition at line 72 of file xmlize.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations