password_hash function in php code example
Example 1: hash a password php
password_hash("MySuperSafePassword!", PASSWORD_DEFAULT)
password_verify("MySuperSafePassword!", $hashed_password)
Example 2: password_hash() php 7
<?php
$options = [
'cost' => 11,
'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),
];
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n";
?>
Example 3: password_hash
<?php
$password = 'idkWhatToUse';
$hashedPassword= password_hash($password, PASSWORD_DEFAULT);
?>