password_hashCreates a password hash Description
string password_hash
( string
$password
, integer $algo
[, array $options
] )password_hash creates a new password hash using a strong one-way hashing algorithm. The following algorithms are currently supported:
Parameters
Return Values
Returns the hashed password, or Examples
Example #1 password_hash example
<?php The above example will output: $2y$10$.vGA1O9wmRjrwAVXD98HNOgsNpDczlqm3Jq7KnEd1rVAGv3Fykk1a
Example #2 password_hash example setting cost manually
<?php The above example will output: $2y$12$QjSH496pcT5CEbzjD/vtVeH03tfHKFy36d4J0Ltp3lRtee9HDxY3K
Example #3 password_hash example setting salt manually
<?php The above example will output: $2y$11$q5MkhSBtlsJcNEVsYh64a.aCluzHnGog7TQAKVmQwO9C8xb.t89F.
Example #4 password_hash example finding a good cost
<?php The above example will output: Appropriate Cost Found: 11 NotesCaution
It is strongly recommended that you do not generate your own salt for this function. It will create a secure salt automatically for you if you do not specify one.
|