The usual approach for this is not an asynchronous strategy, only on the server side, as this does not match the way php works. Instead, this strategy applies:
html- , , API. . , , javascript, . ajax , , API, . , ajax, html .
, / API . , , , , .
, , API . , , ajax . , ajax, . , .
, , php. . , API. ajax API .