Page 1 of 1

Doubt on simplexml_load_file()

Posted: Tue Jun 19, 2007 9:01 am
by aananth_it
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hai,
     i am Ananth working as a PHP developer. Now i have a doubt on simplexml_load_file() function. this function is not working. My code is

Code: Select all

$myGroceryList = "groceries.xml" ; 

	if (file_exists('groceries.xml')) 
	{
		$xml = @simplexml_load_file('groceries.xml');
		print_r($xml);
	}
	else
	{
		exit('Failed to open groceries.xml.');
	}
In this above code with out this @ symbol before simplexml_load_file() function i will not loaded. It's give a error message like

Fatal error: Call to undefined function: simplexml_load_file() in c:\phpdev\www\ananth\19_06_07\list.php on line 8

Reply me please.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Jun 19, 2007 9:10 am
by Gente
Version of PHP?

Version

Posted: Tue Jun 19, 2007 11:45 pm
by aananth_it
PHP Version 4.2.3

Posted: Tue Jun 19, 2007 11:51 pm
by feyd
SimpleXML is not in PHP 4.

Version

Posted: Wed Jun 20, 2007 12:32 am
by aananth_it
Then which version will support the function simplexml_load_file().
Then which function() will support in the PHP version 4.2.3 to load XML file

Posted: Wed Jun 20, 2007 12:33 am
by feyd

Posted: Wed Jun 20, 2007 1:02 am
by staar2
Is better to use Dom xml or simple xml, wich one of them is better. I know that simple xml is lot of easier what about DOM XML ?

Posted: Wed Jun 20, 2007 1:14 am
by feyd
It all comes down to which one is available given your installation.

Posted: Wed Jun 20, 2007 1:34 am
by staar2
But DOM XML is faster ?

Posted: Wed Jun 20, 2007 2:17 am
by volka
I haven't seen speed comparisons. But they all (domxml, dom, simplexml) use the same underlying library so there shouldn't be much of a difference.