I need to reponse to a client with both some binary data (a PDF file) and some additional data as JSON
How is this possible?
I can do this to send the PDF back to the client, but how to send the JSON string in the same response?
The call is done via an API so there is not a browser in the other end
header('Content-Type: '.$type);
header('Content-Disposition: attachment; filename="'.$filename.'"');
header('Content-Length: '.strlen($body));
echo $body;