Take the output of gzdeflate()
, for example:
$a = gzdeflate('..........');
echo $a . "
" . strlen($a);
I get output like:
?Ӄ
5
So I've got a 5 byte string that contains characters which cannot be outputted properly, and hence cannot be copy and pasted.
Obviously, echo gzinflate('?Ӄ');
doesn't work, but echo gzinflate($a)
does.
Is there any way to get the actual contents of $a
onto my clipboard or output it in such a way that I could copy and paste it into gzinflate()
to retrieve the original string? The only workaround I've found is something like:
$a = base64_encode(gzdeflate('..........'));
echo $a;
Which gives me:
09ODAQA=
That's friendly enough to do echo gzinflate(base64_decode('09ODAQA='));
and get ..........
, but I'd like to skip the base64 functions if possible.