PHP » GoLang |
login |
register |
about
|
GoLang simplexml_load_string
request it (361)
GoLang replacement for PHP's simplexml_load_string
[edit | history]
simplexml_load_string(PHP 5, PHP 7) simplexml_load_string — Interprets a string of XML into an object Description
SimpleXMLElement simplexml_load_string
( string
$data
[, string $class_name = "SimpleXMLElement"
[, int $options = 0
[, string $ns = ""
[, bool $is_prefix = FALSE
]]]] )Takes a well-formed XML string and returns it as an object. Parameters
Return Values
Returns an object of class SimpleXMLElement with
properties containing the data held within the xml document, or Warning
This function may
return Boolean Errors/Exceptions
Produces an Tip
Use libxml_use_internal_errors() to suppress all XML errors, and libxml_get_errors() to iterate over them afterwards. Examples
Example #1 Interpret an XML string
<?php The above example will output: SimpleXMLElement Object ( [title] => Forty What? [from] => Joe [to] => Jane [body] => I know that's the answer -- but what's the question? ) At this point, you can go about using $xml->body and such. See Also
|
more
Recently updated
more
Most requested
more
Last requests
|