View Single Post
  #8 (permalink)  
Old 01-26-2008, 07:00 PM
Geoserv Geoserv is offline
Banned
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
Quote:
Originally Posted by manya1011 View Post
actually

It works sometimes not all of the time.. It will depend on how the websites have it setup.

It worked when it was just title as the address but when they had for example..

What : Something : The story


Something would show up and not story...

I think the code only Eliminates if they have it setup like Website name : the story..

so eliminates everything before the :
Change the code to this so if the format is that or website name: page title it will work:

Code:
if(preg_match("'<title>([^<]*?)</title>'", $this->html, $matches)) {
            $url_title=trim($matches[1]);
            $url_title = preg_split("/:|\-/", $url_title);
            $url_title = array_slice($url_title, -1);
            $this->url_title = $url_title[0];
Geoserv.
Reply With Quote
The Following User Says Thank You to Geoserv For This Useful Post: