Jump to content

Screening files to open using file_get_contents()


ThePsion5

Recommended Posts

Hi,I'm trying to use the file_get_contents() to crawl websites, but i'd also like to screen what kind of files i'd be opening using the 'context' option (to exclude .pdf files, for example). I believe this is possible, but I don't really know how. Any ideas?

Link to comment
Share on other sites

Hi,I'd also like to screen what kind of files i'd be opening using the 'context' option
As in, I don't want to exclude files that way specifically, as the logic designed to filter files is located in a different object...What I do want to do is exclude non-text-based files because that is a universal specification. As in, i don't want to say "no .pdf, .wmv, or .avi files" or "only .htm, .php, and .html files" but no non-textual files. Perhaps I could use something with MIME types for this?
Link to comment
Share on other sites

Sadly, I can't use that functions without enabling it in the PHP.ini file, which is my problem (If I had administrative access i'd just use the PECL extension, lol). I wonder if I should go through the arcane profess of using binary to determine the MIME type? *gulps*

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...