Code: 
<?php
    class JString {
        private $string = "";
    
        public function __construct($str) {
            $this->string = $str;
        }
        
        public function uri($sep='-') {
            return trim(preg_replace('#[^\w\-]+#', $sep, $this->string), $sep);
        }
        
        public function uc() {
            return ucwords($this->string);
        }
        
        public function truncate($len=15) {
            return strlen($this->string) > $len ? substr($this->string, 0, $len) . '...' : $this->string;
        }
        
        public function advtrunc($words=10, $len=NULL) {
            if(strpos($this->string, ' ') === false) {
                if(empty($len))
                    return $this->string;
                else
                    return strlen($this->string) > $len ? substr($this->string, 0, $len) . '...' : $this->string;
            }
            if(str_word_count($this->string) <= $words)
                return $this->string;
            $estring = explode(' ', $this->string);
            return implode(' ', array_slice($estring, 0, $words)) . '...';
        }
    }
    
    // Testing
    echo '<pre>';
        $jmz = new JString('so its like 4:30am here and i figured id throw up some random code for the public for once, who knows who will use it.');
    var_dump($jmz->uri());
    var_dump($jmz->uc());
    var_dump($jmz->truncate());
    var_dump($jmz->advtrunc());
    echo '</pre>';
?>


EDIT:

FYI...
uri() - Format the string so it is safe for use in an SEO URI
uc() - Upper case the first letter of each word
truncate() - ... the string if it is too long
advtrunc() - ... the string and/or remove words if there are too many words or it is too long
JmZ Reviewed by JmZ on . 04:33 10/11/2010 <?php class JString { private $string = ""; public function __construct($str) { $this->string = $str; } public function uri($sep='-') { return trim(preg_replace('#+#', $sep, $this->string), $sep); Rating: 5