note 110697 added to simplexml.examples-errors
| From: | Christoph | Date: | Fri, 23 Nov 2012 13:33:36 +0000 |
| Subject: | note 110697 added to simplexml.examples-errors | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192121@lists.php.net to get a copy of this message | ||
As an extension to the comment before from openbip at gmail dot com:
To avoid that an empty object as a result from an XML like <root /> is also regarded as a
failure, even though nothing went technically wrong you can also check:
<?php
if (!($sxe instanceof SimpleXMLElement)) {
//Something went wrong.
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 24.134.194.50
----
Manual Page -- http://www.php.net/manual/en/simplexml.examples-errors.php
Edit -- https://master.php.net/note/edit/110697
Del: integrated -- https://master.php.net/note/delete/110697/integrated
Del: useless -- https://master.php.net/note/delete/110697/useless
Del: bad code -- https://master.php.net/note/delete/110697/bad+code
Del: spam -- https://master.php.net/note/delete/110697/spam
Del: non-english -- https://master.php.net/note/delete/110697/non-english
Del: in docs -- https://master.php.net/note/delete/110697/in+docs
Del: other reasons-- https://master.php.net/note/delete/110697
Reject -- https://master.php.net/note/reject/110697
Search -- https://master.php.net/manage/user-notes.php