Rifts Posted April 27, 2011 Share Posted April 27, 2011 hey guys im having a ton of trouble doing a very simple thing im trying to follow this: http://www.w3schools.com/PHP/php_xml_simplexml.asp but if i copy paste that code it doesn't work I just get these errors: Warning: simplexml_load_file() [function.simplexml-load-file]: test.xml:1: parser error : Start tag expected, '<' not found in /home/content/54/6407054/html/dev1/d2/index.php on line 2 Warning: simplexml_load_file() [function.simplexml-load-file]: <?xml version="1.0" encoding="ISO-8859-1"?>਀㰀渀漀ç€æ”€ã¸€ in /home/content/54/6407054/html/dev1/d2/index.php on line 2 Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /home/content/54/6407054/html/dev1/d2/index.php on line 2 Fatal error: Call to a member function getName() on a non-object in /home/content/54/6407054/html/dev1/d2/index.php on line 4 what is going on? i am using php 5 and simplexml is enabled. Quote Link to comment https://forums.phpfreaks.com/topic/234904-xml-to-php-not-working/ Share on other sites More sharing options...
Rifts Posted April 27, 2011 Author Share Posted April 27, 2011 anyone Quote Link to comment https://forums.phpfreaks.com/topic/234904-xml-to-php-not-working/#findComment-1207234 Share on other sites More sharing options...
JKG Posted April 27, 2011 Share Posted April 27, 2011 hmm worked for me. utf8? xml file is local? Quote Link to comment https://forums.phpfreaks.com/topic/234904-xml-to-php-not-working/#findComment-1207246 Share on other sites More sharing options...
Rifts Posted April 27, 2011 Author Share Posted April 27, 2011 i figured it out.. the xml file was not being saved with unix format does anyone know how to make this happen automatically? Quote Link to comment https://forums.phpfreaks.com/topic/234904-xml-to-php-not-working/#findComment-1207252 Share on other sites More sharing options...
JKG Posted April 27, 2011 Share Posted April 27, 2011 do you mean your line endings? if so i can set it in prefs.. Quote Link to comment https://forums.phpfreaks.com/topic/234904-xml-to-php-not-working/#findComment-1207255 Share on other sites More sharing options...
Rifts Posted April 28, 2011 Author Share Posted April 28, 2011 yea where Quote Link to comment https://forums.phpfreaks.com/topic/234904-xml-to-php-not-working/#findComment-1207287 Share on other sites More sharing options...
JKG Posted April 28, 2011 Share Posted April 28, 2011 EDIT: thats in coda. Quote Link to comment https://forums.phpfreaks.com/topic/234904-xml-to-php-not-working/#findComment-1207430 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.