A
A
aopil2019-11-04 22:10:29
Parsing
aopil, 2019-11-04 22:10:29

How to combine 2 requests into one html?

Task: Combine information from 2 or more different queries.
I need to generate HTML which I must eventually write to the database.
There are 2 sites that I have to make requests to, different sites give different information, sites respond through the callback option, i.e. - sent a request and you need to accept the answer on my side, all I do is.
As a result, having accepted the callback, we have something like this:

Сайт 1 вернул:
$html1 = "Погода в Москве: <span style="color: red">-5";
Сайт 2 вернул:
$html2 = "Погода в Барселоне: <span style="color: green">+19";

Then, I need to somehow combine the information into a variable $REPLYand write it to the database.
CallBack is received in different php files and they can come at different times.
Question regarding $html1 and $html2 how and what to do with them? Where to write them down and how to combine them? Tell me how it is implemented?
It only occurs to me to create a .txt file to write down information about requests there and then somehow form html from this, but it’s a mess in my head, maybe there are examples or more correct ways of implementation? Writing $html1 and $html2 to the database and then pulling it out of the database sounds somehow not very good, you have to create 100 columns in the database.
My main script is written in PHP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2019-11-05
@xmoonlight

1. Generators ( publication )
2. https://amphp.org/amp/ ( publication )
(3. multi_curl )
+ Bonus

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question