I have a script that looks for <title> tags, but it doesn't seem to be picking up the titles, can anyone tell me why?
 
 
 Almost all of the web pages look like:
 
<?
 if(!isset($mainfile)) { include("mainfile.php"); }
 if(!isset($headers_sent)) { include("header.php"); }
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
 <HTML>
 <HEAD>
    <TITLE>Some Title</TITLE>
    <META NAME="Author" CONTENT="Some Name">
       </HEAD>
 <BODY>
 
 
Here's my function:
 
 function getTitle(&$doc)
 {
         if (eregi("<title>(.*)</title>", $doc, $titlematch))
                 $title = trim(eregi_replace("[[:space:]]+", " " , $titlematch[1]));
         else
                 $title = "";
         if ($title == "")
                 $title = "Untitled Document";
         return $title;
 }
 
it runs okay...
 But, when I use the function, everything is coming back as "Untitled Document".
 
Any suggestions?
 
 
Clayton Dukes
 ---------------------------------------------------------------------
 Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to