Re: Retrieving Content

From: Date: Fri, 02 Jun 2006 16:11:27 +0000
Subject: Re: Retrieving Content
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-237293@lists.php.net to get a copy of this message
Actualy I went a slightly diffent way, I tried to use the file() like on the script below and I get the content of the whole page but when I try to get a single line from the array it all goes sideways. Here goes the script with the correct urls, remembering that I'm using it on the local server thats why I save it on the file to see if its getting the right content: $fc = file('http://www.fanfiction.net/s/979216/1/'); $f=fopen("some.txt","w"); foreach($fc as $line) {
    if ($line[85])
    { //look for $key in each line
          fputs($f,$line[85]);
    } //place $line back in file
    echo "$line";
} It shows the whole page but saves on the file something grambled that I cant identify what it is. Iknow that when opening the html result of the page that I need to get the content its the second SELECT, and its actually on line 86, but since the PHPEd dont use line 0 it should be right. Or I'm missing something... Thanks, Rodrigo

« previous php.general (#237293) next »