hello!
normally, if you are given binary data in a string (such as from a call to
fread), you can call the strlen function on this string to get its size:
$buffer = fread($file, 100000);
if (strlen($buffer ) < 100000)
{
echo "read less than 100000 bytes";
}
etc
now, the problem is, on systems where you have the mbstring extension
turned on, and are using function substitution to replace strlen with
mb_strlen, you are pretty much guaranteed to get a WRONG value back from
strlen, since it will find some multi-byte lead characters in that binary
file eventually.
so the question is:
are there any other methods to find the length of a string besides strlen?
the only way i can see to not screw myself right now is to not use function
substitution. any other options?
thanks,
mark.
--
I am not an ANGRY man. Remove the rage from my email to reply.
Comment