Answer the question
In order to leave comments, you need to log in
How to save the result of simplexml_load_file operation correctly?
How to correctly save the result of the simplexml_load_file function to a php file?
Tried to directly put the value in file_put_contents but the result is an empty file.
$xml_object = simplexml_load_file($val);
file_put_contents($dir_indices . "/" . $file_name . ".php", $xml_object, LOCK_EX);
Answer the question
In order to leave comments, you need to log in
$xml_object you have this (suddenly) exactly xml object (and not a string variable). Therefore, you cannot write it to a file. And it's not entirely clear why.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question