Code Comments
Programming Forum and web based access to our favorite programming groups.Hi! I'd need to extract the information inbetween the <title></title> Tags of quite a lot of webpages. Currently I'm fetching the pages with curl and extract the titles with preg_match. That's quite nice, and it's working, but on the other hand much more data is transfered (the whole body of the webpages) than needed. Can anyone of you give me a hint if and how it's possible to just request the header of a webpage? I'm fine with a RTFM if you can point me to the FM I should R. Thanks in advance for your help, Andreas
Post Follow-up to this messageAndreas Stallmann wrote: > Hi! > > I'd need to extract the information inbetween the <title></title> Tags > of quite a lot of webpages. Currently I'm fetching the pages with curl > and extract the titles with preg_match. > > That's quite nice, and it's working, but on the other hand much more > data is transfered (the whole body of the webpages) than needed. > > Can anyone of you give me a hint if and how it's possible to just > request the header of a webpage? I'm fine with a RTFM if you can point > me to the FM I should R. > > Thanks in advance for your help, > > Andreas check into fopen() and fread() on www.php.net -- Norman Registered Linux user #461062
Post Follow-up to this messageOn 29 f=E9v, 17:39, Andreas Stallmann <andreas.stallm...@web.de> wrote:
> Hi!
>
> I'd need to extract the information inbetween the <title></title> Tags
> of quite a lot of webpages. Currently I'm fetching the pages with curl
> and extract the titles with preg_match.
>
> That's quite nice, and it's working, but on the other hand much more
> data is transfered (the whole body of the webpages) than needed.
>
> Can anyone of you give me a hint if and how it's possible to just
> request the header of a webpage? I'm fine with a RTFM if you can point
> me to the FM I should R.
>
> Thanks in advance for your help,
>
> Andreas
Hi Andrea,
Norman answered you fine.
Maybe this also helps:
<?php
// get contents of a url into a string
$filename =3D "http://www.someurl.com";
$handle =3D fopen($filename, "r");
$contents =3D '';
while (!feof($handle)) {
$contents .=3D fread($handle, 8192);
}
fclose($handle);
print "Content of " . $filename . ":<p>" . $contents;
?>
Regards
Luisa
Post Follow-up to this messageHi Luisa, thank's for your help. That... vrlist.info schrieb: > $handle = fopen($filename, "r"); ...did the job. TNX, A.
Post Follow-up to this message[url=http://www.BestGBlog.com/Watch?movie=726071]Lindsay Lohan and Alyson Han nigan Lick Pussies On Sofa![/url]
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.