|
Posted by Gordon Burditt on 02/18/07 04:21
>Is it possible in PHP to determine whether a file is (intended as)
>binary or ascii data other than by examining its extension? I can't find
>a ready-made function or script online that does so.
>
>If I open a file with less on my linux box for example it warns when it
>'thinks' it's binary rather than ascii.
An 'ascii' file probably does not contain control characters (codes
0 - 31 or 127) other than tab, carriage return, line feed, possibly
form feed, and possibly backspace. Depending on the character set,
it may not contain codes 128 - 255 either.
Navigation:
[Reply to this message]
|