I run a Digg style website that allows people to submit blog posts etc...
I have been trimming the URL titles automatically using:
PHP Code:
if( preg_match( '~<title>(.*?)([^:\-]*?)</title>~is', str_replace( '»', ':', $this->html ), $matches ) )
{
$this->url_title = $matches[2];
}
this took a page title formatted like:
Code:
Website name - Post title
and made it:
Now I am trying to reverse it so that it will make it the opposite and only take the "Website name" like in the example above.
But for the life of me, I cannot get it to work.
What is the proper way of doing this?
Thanks.
Bookmarks