Welcome Guest, Not a member yet? Register   Sign In
simplexml_load_string() throws warning error if xml is not valid
#1

[eluser]Zac G.[/eluser]
I have a script that is pulling results from Amazon. The script returns non-valid XML when there are no results from Amazon (this is on Amazon's end) and it is causing the simplexml_load_string() function to throw a warning.

Is this something within CI or just PHP? Thanks!
#2

[eluser]TheFuzzy0ne[/eluser]
What's the warning message? You can disable warnings from showing on your Web site via the root index.php file, as by default CodeIgniter will show all warnings and errors. Depending on your log level, I think CodeIgniter can write PHP errors and warnings to your log file. I know that it can write errors, just not sure about the warnings.
#3

[eluser]Zac G.[/eluser]
The warning message was displaying just because the XML being passed was not valid, and that is what the warning was saying. Since it is just a warning I am not too worried :p

But I guess it is a PHP thing and not an CI thing.
#4

[eluser]TheFuzzy0ne[/eluser]
It sounds like a PHP thing, for sure. Is there no way you can suppress the warning with an '@'?
#5

[eluser]Zac G.[/eluser]
Yup, I was able to suppress it :p I just wanted to make sure that it was okay to suppress it first.




Theme © iAndrew 2016 - Forum software by © MyBB