Answer the question
In order to leave comments, you need to log in
How to change the content of the .html page using an external php file?
Actually, there is such a task:
You need to write a parser in php, which will parse the page on a third-party server once an hour, after which, based on the result of this parsing, you need to replace the code fragment in the .html page.
I will write the parsing and the daemon itself, but the main snag is changing the code in the .html file using an external .php parser.
For simplicity, I just ask you to help me do this thing:
Let's say we have a .html page with the content "a" and the means of the .php file need to change this "a" to "b" ...
I tried to describe it as clearly as possible. Thanks in advance for any possible help.
Answer the question
In order to leave comments, you need to log in
$html = file_get_contents('my-page.html');
$result = str_replace('а', 'б', $html);
why such difficulties? daemon, php...
bash+curl/wget+sed+cron
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question