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>&nbsp;&nbsp; $title = substr($title, 0, strpos($title, &quot;|&quot;));<br>
<br>Just outside the first &quot;if&quot; loop.&nbsp; For the sake of the future searchers:<br><br>function getTitle($file){<br>&nbsp;&nbsp;&nbsp; global $htmltypes;<br>&nbsp;&nbsp;&nbsp; $title=&quot;&quot;;<br>&nbsp;&nbsp;&nbsp; $p=pathinfo($file);<br>&nbsp;&nbsp;&nbsp; if(!in_array(strtolower($p[&#39;extension&#39;]),$htmltypes)){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $f=file_get_contents($file);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(preg_match(&quot;&#39;&lt;title&gt;(.+)&lt;/title&gt;&#39;i&quot;, $f, $matches)){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $title=$matches[1];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; $title = substr($title, 0, strpos($title, &quot;|&quot;));<br>
&nbsp;&nbsp;&nbsp; $title=$title?$title:basename($file);<br>&nbsp;&nbsp;&nbsp; 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> &lt;<a href="mailto:gentgeen@wikiak.org">gentgeen@wikiak.org</a>&gt; 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 -&nbsp; <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>&nbsp; I searched the site for some form of &quot;contact me&quot; 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.&nbsp; The one problem I have is that all our pages have a title format of:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PAGE TITLE | COMPANY NAME<br>

<br>So my sitemap then gets filled with &quot; | COMPANY NAME&quot; after every single page title - very cluttered and difficult to browse.&nbsp; It could work, but I would really like to clean it up some.&nbsp; I would like to add to the PHP function the equivalent of the command:<br>

&nbsp;&nbsp;&nbsp;&nbsp; cut -f1 -d&quot;|&quot; <br>But I have no idea how to do so.<br><br>Here is the function <br><br>function getTitle($file){<br>&nbsp;&nbsp;&nbsp; global $htmltypes;<br>&nbsp;&nbsp;&nbsp; $title=&quot;&quot;;<br>&nbsp;&nbsp;&nbsp; $p=pathinfo($file);<br>&nbsp;&nbsp;&nbsp; if(!in_array(strtolower($p[&#39;extension&#39;]),$htmltypes)){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $f=file_get_contents($file);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(preg_match(&quot;&#39;&lt;title&gt;(.+)&lt;/title&gt;&#39;i&quot;, $f, $matches)){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $title=$matches[1];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; $title=$title?$title:basename($file);<br>

&nbsp;&nbsp;&nbsp; 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&nbsp;&nbsp;&nbsp;&nbsp;<br> your own reputation; for &#39;tis better to be alone then in bad <br> company.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- 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&nbsp;&nbsp;&nbsp;&nbsp;<br>
 your own reputation; for &#39;tis better to be alone then in bad <br> company.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- George Washington, Rules of Civility