Node no longer exists using SimpleXML

前端 未结 2 1821
长发绾君心
长发绾君心 2021-01-23 00:00

Trying to cache an xml file using the build in wordpress function called get_transient but I\'m getting a php error:

unserialize() [function.unserialize]: Node

2条回答
  •  星月不相逢
    2021-01-23 00:31

    You shouldn't (can't?) serialize and unserialize the SimpleXML object. It's XML, which is a serialization format to begin with. This ain't Inception here!

    Call the asXML method to get the actual XML, then store that instead.

提交回复
热议问题