Download file from URL and save to same folder as PHP file, replace old one

ساخت وبلاگ
Hello,
me and my friend are working on WP, trying to save file from URL to server. Well, we tried almost 50+ codes to get any PHP file to work, but with no luck:

We have this link for our file: https://www.example.com/word-or-exce...1c163078dfabf2
If we run this URL in browser, we get .xml file, another link provides us updated .doc file. That URL does not change in time.

We are hoping to have it simple as we are not good at coding: so we are planning to run cronjob, which would execute PHP hourly, so PHP would save file to same location as PHP file stored, rename it and if there is a same file, replace it with newer one.

Does someone have any idea how to do it? More simple, better.
Thank you...
Jane
CodingForums...
ما را در سایت CodingForums دنبال می کنید

برچسب : نویسنده : codingforums بازدید : 261 تاريخ : چهارشنبه 6 تير 1397 ساعت: 3:36