Password encryption and authentication
password_hash- Creating a hash of the password (hash)
String Password_hash (String $password, Integer $algo [, array $options])
Currently supported algorithms ($ALGO parameters): 1. Password_default-Use the bcrypt algorithm (PHP 5.5.0 default). Note that this constant will change as PHP joins the newer, higher-intensity algorithm. Therefore, the length of the resulting result using this constant will change in the future. Therefore, the columns in the database that store the results can be more than 60 characters (preferably 255 characters). 2. Password_bcrypt-Creates a hash using the crypt_blowfish algorithm. This results in a compatible crypt () that uses "$2y$". The result will be a 60-character string, or FALSE on failure.
password_verify- Verify that the password matches the hash
Boolean password_verify (String $password, String $hash)
Example:
$password = "123456";//Gets the encrypted string $hash = Password_hash ($password, Password_default);//authentication Password $input = "123456"; if ( Password_verify ($input, $hash)) echo "password is correct"; else echo "Password error";
get_headers
Gets all headers sent by the server in response to an HTTP request.
Array get_headers (string $url [, int $format = 0])
Parameters:
url - The destination URL.
format - If the optional parameter is format set to 1, get_headers () parses the corresponding information and sets the key name of the array.
Bccomp
Compare two arbitrary-precision numbers for high-precision floating-point comparison.
int Bccomp (String $left _operand, String $right _operand [, int $scale = int])
Parameters: The function of the $scale is to set the comparison to the decimal point.
return value:
If the number on the left of the two number left_operand compares to the number equal to the right right_operand returns 0,
The number on the left left_operand compares to the number on the right to right_operand return 1,
The number on the left left_operand compares the number of the right to the right_operand small return-1.
PHP function Tips (i)