note 120167 added to book.simplexml

From: Date: Tue, 15 Nov 2016 09:49:06 +0000
Subject: note 120167 added to book.simplexml
Groups: php.notes 
Request: Send a blank email to php-notes+get-207106@lists.php.net to get a copy of this message
I had to do the following to catch the fact that my simplexml_load_string call was not working right (it was returning empty objects). $statistik = simplexml_load_string($record,"SimpleXMLElement",LIBXML_NSCLEAN,$ns,TRUE); if (($statistik === FALSE) or ($statistik === NULL) or empty($statistik)) { echo "$ctr) STATISTIK ERROR---\n"; var_dump($statistik); echo "\n\n"; echo "Failed loading XML\n"; foreach(libxml_get_errors() as $error) { echo "\n", $error->message; } die(); } before I put the check for "empty()" I was not catching the error. ---- Server IP: 72.52.91.14 Probable Submitter: 62.242.206.54 ---- Manual Page -- http://php.net/manual/en/book.simplexml.php Edit -- https://master.php.net/note/edit/120167 Del: integrated -- https://master.php.net/note/delete/120167/integrated Del: useless -- https://master.php.net/note/delete/120167/useless Del: bad code -- https://master.php.net/note/delete/120167/bad+code Del: spam -- https://master.php.net/note/delete/120167/spam Del: non-english -- https://master.php.net/note/delete/120167/non-english Del: in docs -- https://master.php.net/note/delete/120167/in+docs Del: other reasons-- https://master.php.net/note/delete/120167 Reject -- https://master.php.net/note/reject/120167 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#207106) next »