Morgan Hughes wrote:
On Fri, 29 Nov 2002, Jonathan Sharp wrote:
Is there a way to determine if a string has ascii or binary data in it?
I just wrote this, it seems to work. I've used mhash to generate a
binary string. It will fail if:
a) The strings use obscure ASCII control
At 13:38 30.11.2002, Beth Gore said:
[snip]
Add a break statement once you've detected binary, for optimization
(binary might be just some length...)
?php
function isbinary($input)
{
/* This simple function returns true if there's any
Is there a way to determine if a string has ascii or binary data in it?
-js
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, 29 Nov 2002, Jonathan Sharp wrote:
Is there a way to determine if a string has ascii or binary data in it?
I've used this kind of approach in the past to determine which encoding
to use on a string which may contain text or an image. Basically it
uses addcslashes to escape
4 matches
Mail list logo