D
D
devidwm2018-10-02 14:26:26
PHP
devidwm, 2018-10-02 14:26:26

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

1 answer(s)
A
Anton Shamanov, 2018-10-02
@devidwm

$xml = file_get_contents("https://gabestore.ru/sitemap.xml");

works fine

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question