Re: [PHP] test for ascii or binary string

2002-11-30 Thread Beth Gore
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

Re: [PHP] test for ascii or binary string

2002-11-30 Thread Ernest E Vogelsinger
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

[PHP] test for ascii or binary string

2002-11-29 Thread Jonathan Sharp
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

Re: [PHP] test for ascii or binary string

2002-11-29 Thread Morgan Hughes
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