note 115630 rejected from function.simplexml-load-file by sobak

From: Date: Fri, 29 Aug 2014 05:45:40 +0000
Subject: note 115630 rejected from function.simplexml-load-file by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-200338@lists.php.net to get a copy of this message
Note Submitter: nirav dot vyas at freemindtech dot in ---- 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

« previous php.notes (#200338) next »