In PHP recently I faced this issue. When I tried to use my xml file using php's document load() function.
Problem
The reason why it's happening is because I called a load() method in the DOMDocument class in which is not static.
Instead of calling it with :: We need to call it with ->
I found PHP document about the usage of DOMDocument load() method.
Have any doubt feel free to comment here!
Problem
$dom = DOMDocument::load('myXml.xml');
It works perfectly. But I throws errorStrict Standards: Non-static method DOMDocument::load() should not be called statically
SolutionThe reason why it's happening is because I called a load() method in the DOMDocument class in which is not static.
Instead of calling it with :: We need to call it with ->
I found PHP document about the usage of DOMDocument load() method.
$doc = new DOMDocument();
$doc->load('myXml.xml');
Now the error is gone...!!!Have any doubt feel free to comment here!
0 comments:
Post a Comment