Is it possible to get the content of a URL with PHP (using some sort of function like file_get_contents or header) but only after the execution of
file_get_contents
header
I think the easiest and best way is using this package https://github.com/spatie/browsershot just install it completely and use the below code
Browsershot::url('https://example.com')->bodyHtml()