I run a Digg style website that allows people to submit blog posts etc...
I have been trimming the URL titles automatically using:
this took a page title formatted like:
if( preg_match( '~<title>(.*?)([^:\-]*?)</title>~is', str_replace( '»', ':', $this->html ), $matches ) )
$this->url_title = $matches;
and made it:
Website name - Post title
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?