title: How to determine file_get_contents structure before reading through the file?
body: <p>I am trying to fetch the meta information from URL results passed after a search. I have been using the OpenGraph library and also PHP's native <code>get_meta_tags</code> function to retrieve the meta tags.</p>
  
  <p>My problem is when I am reading through the contents of a URL that happens to be a <code>.m4v</code> extension. The program tries to read the contents of that file but it is way too large (and not mention, completely useless as it is all junk) and my program refuses to let it go. Therefore, I am stuck till the program throws a timeout error and moves on.</p>
  
  <p>Is there any way to stop reading the contents of the file if it is way too large? I tried <code>file_get_contents()</code> with the <code>maxlen</code> parameter, but it still seems to read through the entire page. How can I quickly determine if a file is structured with tags before I dive in to farm it for meta?</p>