lib/Phaker/Generator/Internet.php
public function user_name($name = NULL)
	{
		$delim = array('.', '_');

		if ($name)
		{
			$names = preg_split('/[^\w]+/', $name, NULL, PREG_SPLIT_NO_EMPTY);
			shuffle($names);
			return implode($delim[array_rand($delim)], $names);
		}

		if (mt_rand(0, 1))
		{
			$name = preg_replace('/\W/', '', \Phaker::name()->first_name);
		}
		else
		{
			$names = preg_replace('/\W/', '', array(\Phaker::name()->first_name, \Phaker::name()->last_name));
			$name  = implode($delim[array_rand($delim)], $names);
		}

		return static::fix_umlauts(strtolower($name));
	}
public function user_name($name = NULL)
	{
		$delim = array('.', '_');

		if ($name)
		{
			$names = preg_split('/[^\w]+/', $name, NULL, PREG_SPLIT_NO_EMPTY);
			shuffle($names);
			return implode($delim[array_rand($delim)], $names);
		}

		if (mt_rand(0, 1))
		{
			$name = preg_replace('/\W/', '', \Phaker::name()->first_name);
		}
		else
		{
			$names = preg_replace('/\W/', '', array(\Phaker::name()->first_name, \Phaker::name()->last_name));
			$name  = implode($delim[array_rand($delim)], $names);
		}

		return static::fix_umlauts(strtolower($name));
	}
public function user_name ( $ name = NULL ) { $ delim = array ( '.' , '_' ) ; if ( $ name ) { $ names = preg_split ( '/[^\w]+/' , $ name , NULL , PREG_SPLIT_NO_EMPTY ) ; shuffle ( $ names ) ; return implode ( $ delim [ array_rand ( $ delim ) ] , $ names ) ; } if ( mt_rand ( 0 , 1 ) ) { $ name = preg_replace ( '/\W/' , '' , \ Phaker :: name ( ) -> first_name ) ; } else { $ names = preg_replace ( '/\W/' , '' , array ( \ Phaker :: name ( ) -> first_name , \ Phaker :: name ( ) -> last_name ) ) ; $ name = implode ( $ delim [ array_rand ( $ delim ) ] , $ names ) ; } return static :: fix_umlauts ( strtolower ( $ name ) ) ; }
Generate a lowercase user name from a full or partial name.

echo $internet->user_name('Dr. Seuss'); // => "dr.seuss"

@param   string  $name  User name
@return  string
Generate a lowercase user name from a full or partial name .