Loading XML data into simplexml
Loading from string
simplexml_load_string to create a
SimpleXMLElement from a string:
|| must be used here because the precedence of
or is higher than
=. The code after
or will only be executed if
$xml finally resolves to false.
Loading from file
simplexml_load_file to load XML data from a file or a URL:
The URL can be of any schemes that PHP supports, or custom stream wrappers.