Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare html file to another.

Status
Not open for further replies.

eter4

MIS
Mar 13, 2001
30
0
0
CA
I need to grab a webpage and find a specific sentance in it... then compare it to one in a log file. If the 2 are different then log the new entry.

EX: If you have a webpage telling you the last time something was updated. The script would compare this line to a line in a text file. If this date was newer overwrite the file with the new date.


Thanks
 
try this

$remotepage = fopen("while ( $row = fgets($remotepage, 1024)) {
if (strpos($row, "Last update")) { //place you search string there
//now select the string from the row ($current) and compare it to the stored one
if ($stored != $current) {
//store the new one
break;
}
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top