src/ADT/String.php
public function capitalizeWords( $delimiter = NULL )
	{
		$oldString		= $this->string;
		if( !$delimiter || preg_match( "/ +/", $delimiter ) ){
			$this->string	= ucwords( $oldString );
			return $this->string !== $oldString;
		}
		else{
			$token			= md5( (string) microtime( TRUE ) );
			$work			= str_replace( " ", "{".$token."}", $oldString );
			$work			= str_replace( $delimiter, " ", $work );
			$work			= ucwords( $work );
			$work			= str_replace( " ", $delimiter, $work );
			$this->string	= str_replace( "{".$token."}", " ", $work );
			return $this->string !== $oldString;
		}
	}
public function capitalizeWords( $delimiter = NULL )
	{
		$oldString		= $this->string;
		if( !$delimiter || preg_match( "/ +/", $delimiter ) ){
			$this->string	= ucwords( $oldString );
			return $this->string !== $oldString;
		}
		else{
			$token			= md5( (string) microtime( TRUE ) );
			$work			= str_replace( " ", "{".$token."}", $oldString );
			$work			= str_replace( $delimiter, " ", $work );
			$work			= ucwords( $work );
			$work			= str_replace( " ", $delimiter, $work );
			$this->string	= str_replace( "{".$token."}", " ", $work );
			return $this->string !== $oldString;
		}
	}
public function capitalizeWords ( $ delimiter = NULL ) { $ oldString = $ this -> string ; if ( ! $ delimiter || preg_match ( "/ +/" , $ delimiter ) ) { $ this -> string = ucwords ( $ oldString ) ; return $ this -> string !== $ oldString ; } else { $ token = md5 ( ( string ) microtime ( TRUE ) ) ; $ work = str_replace ( " " , "{" . $ token . "}" , $ oldString ) ; $ work = str_replace ( $ delimiter , " " , $ work ) ; $ work = ucwords ( $ work ) ; $ work = str_replace ( " " , $ delimiter , $ work ) ; $ this -> string = str_replace ( "{" . $ token . "}" , " " , $ work ) ; return $ this -> string !== $ oldString ; } }
Changes first letter of every word to upper case and returns TRUE of there were changes.
@access		public
@return		bool		At least 1 character has been changed
@param		string		$delimiter		Capitalize every word separated by delimiter
Changes first letter of every word to upper case and returns TRUE of there were changes .