~`+=,.;:/?|'; $password = ''; for ( $i = 0; $i < $length; $i++ ) { $password .= substr($chars, self::rand(0, strlen($chars) - 1), 1); } // random_password filter was previously in random_password function which was deprecated return $password; } }