RE: [PHP] Parsing HTML tags

2001-04-13 Thread Brian Paulson
I use this function function title($filename,$dir) { $loc = "path/to/dir/where/file/is"; if(is_file("$loc/$filename")) { $open=fopen("$loc/$filename","r"); while(!feof($open)) { $line=fgets($open,255);

Re: [PHP] Parsing HTML tags

2001-04-13 Thread Tobias Talltorp
// Get the webpage into a string $html = join ("", file ("http://www.altavista.com")); // Using eregi eregi("title(.*)/title", $html, $tag_contents); // Using preg_match (faster than eregi) // The i in the end means that it is a case insensitive match preg_match("/title(.*)\/title/i", $html,