As a follow up to my earlier question, I’m thinking of using simplexml_load_file to load an XML file from a URL.
Would it be possible for me to turn that SimpleXML object to a DOMDocument object via (DOMDocument)$my_simplexml?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
dom_import_simplexmlfunction.Quoting :
And, just so it’s said, the exact opposite manipulation can be done using
simplexml_import_dom.Well, it’s not a “cast” ; it’s a function-call… But I guess that would still be OK for your 😉