note 115630 added to function.simplexml-load-file
| From: | nirav dot vyas at freemindtech dot in | Date: | Thu, 28 Aug 2014 05:51:17 +0000 |
| Subject: | note 115630 added to function.simplexml-load-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200331@lists.php.net to get a copy of this message | ||
Hi I am new to php, just started to work on it last week and I am already feeling good coding it :).
So I have a issue for which I need help.. I am using simplexml_load_file, and it works well but
sometimes what happens is the downloaded file is not at all XML and I get list of errors displaying
on browser, what I want is to check if the file is not XML I should skip for the next feed.
I didnt find try catch help ful or may be I am doing it in wrong way. Can someone please help.
$myFilePath = __DIR__ . '/' . "../newsfeeds/error2.xml";
$data = simplexml_load_file($myFilePath);
I am getting error on the lower line.
THanks
Nirav
----
Server IP: 72.52.91.14
Probable Submitter: 182.73.194.206
----
Manual Page -- http://php.net/manual/en/function.simplexml-load-file.php
Edit -- https://master.php.net/note/edit/115630
Del: integrated -- https://master.php.net/note/delete/115630/integrated
Del: useless -- https://master.php.net/note/delete/115630/useless
Del: bad code -- https://master.php.net/note/delete/115630/bad+code
Del: spam -- https://master.php.net/note/delete/115630/spam
Del: non-english -- https://master.php.net/note/delete/115630/non-english
Del: in docs -- https://master.php.net/note/delete/115630/in+docs
Del: other reasons-- https://master.php.net/note/delete/115630
Reject -- https://master.php.net/note/reject/115630
Search -- https://master.php.net/manage/user-notes.php