I convert binary data to JPEG. PHP is cool for this, because I need just to send header('Content-Type: image/jpeg;');
and echo
my binary.
But I have content above that binary like so:
echo 123;
header('Content-Type: image/jpeg;');
$data = hex2bin($CmnObiektZalacznik[0]->Binaria);
echo $data;
It will of course it will warn with Warning: Cannot modify header information - headers already sent by
so i thought it (header and binary JPEG) could be outputed to temporary buffer something like that:
echo 123;
ob_start();
header('Content-Type: image/jpeg;');
$data = hex2bin($CmnObiektZalacznik[0]->Binaria);
echo $data;
ob_end_flush();
But I get to do it?