I'm wondering if there are already some functions or classes available to return whether a file (most likely uploaded) is text based or not. I can probably roll my own, but if something is out there already I'll use that.
$textBased = is_text($fileName);
The MIME type returned when uploading files isn't very good for this. For example, uploading a PHP script the MIME type is "application/octet-stream", but we know a PHP script is just plain text.
Again, I could make my own, and I don't really want anyone going through the trouble of making something just to answer my question. Just wondering if there is already something available that can do that.