Jump to content

simplexml_load_file suddenly stopped breaking on bad byte order marker


FredWilson

Recommended Posts

I've been pulling my hair out for the past couple of hours working with simplexml_load_file().

 

I was attempting to consume a web service generated by asp.net that I've been consuming using CURL and a function to remove the BOM (byte order marker) so that I could load it into simplexml_load_string().

 

When I switched over to  simplexml_load_file() to call the file instead of using CURL and my function, I was getting errors that it could not find the beginning '<' and that the document was empty and so on..

 

I couldn't find anything about simplexml_load_file() handling BOM characters, so I went for a walk.

 

I came back to my desk and refreshed the page.. and it just started working.  I changed nothing!

 

Guess I should be happy that it started working, but I'd sure like to know why it was breaking in the first place, and then why it would suddenly start working without me doing anything.

 

Has anyone else seen anything like this?

 

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.