Forum Moderators: coopster

Message Too Old, No Replies

Parsing text/html file

         

cripplertd

9:00 am on Aug 28, 2007 (gmt 0)

10+ Year Member



I need help parsing the name and # out of this html file, *note this is just one instance of a few hundred, all are in the same pattern, starting with tip1 = 'name<br>number'

tip1 = 'Nate Abeare<br>(810) 625-2374';

This is what I have, exciting huh!


<?php

$url = "http://example.com/prospectlist.html";

$filepointer = fopen($url,"r");

if($filepointer){

while(!feof($filepointer)){

$buffer = fgets($filepointer,4096);

$file .= $buffer;

}

fclose($filepointer);

} else {

die("Could not open file");

}

?>

<?php

$regexname = "/[tip1 = ']/";
preg_match_all($regexname,$file,$match);
$result = $match[1];
echo $result ;

?>

[edited by: eelixduppy at 1:37 pm (utc) on Aug. 28, 2007]
[edit reason] use example.com, please [/edit]

cripplertd

10:45 am on Aug 28, 2007 (gmt 0)

10+ Year Member



cool thanks,

only problem I have now is that in that list I have ppl listed about 12 times, is there any sort of way to run an if statment so it checks to see if the name / # is already on the list as it goes?

This 31 message thread spans 2 pages: 31