I don't know a lot about ashx files. And I have an ashx file, that takes an argument and returns XML document. So I want to write an PHP code that downloads these XML files and saves them in txt format. I tried doing this but it doesn't work =(
<?php
for ($i = 1; $i <= 100; $i++){
$url = "localhost/getdata.ashx?id=".$i;
$file = "files/".$i.".txt";
file_put_contents($file, file_get_contents($url));
}
?>