Answer the question
In order to leave comments, you need to log in
How to download XML file via php rendered by HTML page?
Colleagues, hello!
I have a concern about downloading XML files from pages rendered as HTML. Here is the sitemap.xml on the website https://gabestore.ru/sitemap.xml . But if we go to the page, there is no markup, it is only in the source code. That is, on the xml site, the markup is hardwired into html. How can you save such a page in XML using php?
The standard option to get the file does not work. $xml = simplexml_load_file(' https://gabestore.ru/sitemap.xml ');
This option is also:
<?php
$xml = file_get_contents(" https://gabestore.ru/sitemap.xml ");
file_put_contents("gabestore.xml" , $xml);
?>
Answer the question
In order to leave comments, you need to log in
$xml = file_get_contents("https://gabestore.ru/sitemap.xml");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question