extract pdf file using file_get_contents
<p><code>file_get_contents()</code> can be used to extract the web pages and I have tested image etc. and it gives the result I have used the get_headers function which matched the content type , content length etc., but I have noticed that it is very slow process. I need to extract the <code>pdf</code> link from several web pages and don't want to use  <code>get_headers</code> concept again as it takes much time.
I have thought  of using <code>preg_match()</code> or reg for matching the content and echo them.</p>

<p>At present my code is: </p>

<pre><code> $html = file_get_contents($websitelink); 
 echo $html;
</code></pre>

<p>It is giving the full page content but i have tried get_header also But its damn slow fof giving pdf output</p>

<p>how i can extract only <code>.pdf</code> files from any web page in a very fast way.</p>

<p>please note that i dont want top convert webpage to html in that page there are several links i just want to extract .pdf links </p>
