public static function unique($string)
	{
		//set intitial unique var sting as empty
		$unique = '';

		//split the string into substrings
		$parts = str_split($string);

		//loop through the sting parts array removing duplicated characters
		foreach ($parts as $part) 
		{
			//add this character if it doesnt exist yet
			if( ! strstr($unique, $part) )
			{
				//add this character to the main unique array
				$unique .= $part;

			}

		}

		//return the unique string
		return $unique;

	}
public static function unique($string)
	{
		//set intitial unique var sting as empty
		$unique = '';

		//split the string into substrings
		$parts = str_split($string);

		//loop through the sting parts array removing duplicated characters
		foreach ($parts as $part) 
		{
			//add this character if it doesnt exist yet
			if( ! strstr($unique, $part) )
			{
				//add this character to the main unique array
				$unique .= $part;

			}

		}

		//return the unique string
		return $unique;

	}
public static function unique ( $ string ) { //set intitial unique var sting as empty $ unique = '' ; //split the string into substrings $ parts = str_split ( $ string ) ; //loop through the sting parts array removing duplicated characters foreach ( $ parts as $ part ) { //add this character if it doesnt exist yet if ( ! strstr ( $ unique , $ part ) ) { //add this character to the main unique array $ unique .= $ part ; } } //return the unique string return $ unique ; }
This method removes duplicates from a string

@param string $string The string for which duplicates are to be removed
@return string String with only unique values
This method removes duplicates from a string