Sorry guys and gals ... I should have searched for just 5 mins longer. I re-adjusted my search terms after sending out the email, and found my own solution:<br><br>Just added:<br> $title = substr($title, 0, strpos($title, "|"));<br>
<br>Just outside the first "if" loop. For the sake of the future searchers:<br><br>function getTitle($file){<br> global $htmltypes;<br> $title="";<br> $p=pathinfo($file);<br> if(!in_array(strtolower($p['extension']),$htmltypes)){<br>
$f=file_get_contents($file);<br> if(preg_match("'<title>(.+)</title>'i", $f, $matches)){<br> $title=$matches[1];<br> }<br> }<br> $title = substr($title, 0, strpos($title, "|"));<br>
$title=$title?$title:basename($file);<br> return htmlentities(trim(strip_tags($title)));<br>}<br><br><div><span class="gmail_quote">On 2/1/08, <b class="gmail_sendername">Kevin Squire</b> <<a href="mailto:gentgeen@wikiak.org">gentgeen@wikiak.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
First - Thank you, those of you that replied to my last PHP question - I have not researched what you mentioned yet, but will and will reply back on that thread later.<br><br>I am thinking of using the Dynamic Site Map Generator found here - <a href="http://apptools.com/phptools/dynamicsitemap.php" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://apptools.com/phptools/dynamicsitemap.php</a> I searched the site for some form of "contact me" as well as searched the source code, but had no luck - so I was hoping you all could help me out again.<br>
<br>There is a function that searches the webpages for the TITLE tag, then reports back using the contents of that tag. The one problem I have is that all our pages have a title format of:<br> PAGE TITLE | COMPANY NAME<br>
<br>So my sitemap then gets filled with " | COMPANY NAME" after every single page title - very cluttered and difficult to browse. It could work, but I would really like to clean it up some. I would like to add to the PHP function the equivalent of the command:<br>
cut -f1 -d"|" <br>But I have no idea how to do so.<br><br>Here is the function <br><br>function getTitle($file){<br> global $htmltypes;<br> $title="";<br> $p=pathinfo($file);<br> if(!in_array(strtolower($p['extension']),$htmltypes)){<br>
$f=file_get_contents($file);<br> if(preg_match("'<title>(.+)</title>'i", $f, $matches)){<br> $title=$matches[1];<br> }<br> }<br> $title=$title?$title:basename($file);<br>
return htmlentities(trim(strip_tags($title)));<br>}<br><span class="sg"><br clear="all"><br>-- <br><a href="http://gentgeen.homelinux.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://gentgeen.homelinux.org</a><br>
<br>#############################################################<br>
Associate yourself with men of good quality if you esteem <br> your own reputation; for 'tis better to be alone then in bad <br> company. - George Washington, Rules of Civility
</span></blockquote></div><br><br clear="all"><br>-- <br><a href="http://gentgeen.homelinux.org">http://gentgeen.homelinux.org</a><br><br>#############################################################<br> Associate yourself with men of good quality if you esteem <br>
your own reputation; for 'tis better to be alone then in bad <br> company. - George Washington, Rules of Civility