src/Lib/StringTool.php
public static function get_random_string($length = 10, $chars)
	{
	    $random_string = '';
	    
	    for($i = 0; $i < $length; $i++)
	    {
	        $index = rand(0, strlen($chars) - 1);
	        $random_string .= $chars{$index};
	    }
	    
	    return $random_string;
	}
public static function get_random_string($length = 10, $chars)
	{
	    $random_string = '';
	    
	    for($i = 0; $i < $length; $i++)
	    {
	        $index = rand(0, strlen($chars) - 1);
	        $random_string .= $chars{$index};
	    }
	    
	    return $random_string;
	}
public static function get_random_string ( $ length = 10 , $ chars ) { $ random_string = '' ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ index = rand ( 0 , strlen ( $ chars ) - 1 ) ; $ random_string .= $ chars { $ index } ; } return $ random_string ; }
Return a random string made of the given chars

@param number $length The length of the string to get
@param string $chars A string containing the chars that can compose the generated random string
@return string
Return a random string made of the given chars