password_hash

PHP 5 >= 5.5.0, PHP 7, PHP 8
password_hash - Creates a password hash

Example #1 password_hash example

Result: $2y$10$.vGA1O9wmRjrwAVXD98HNOgsNpDczlqm3Jq7KnEd1rVAGv3Fykk1a
PHP Version:

Example #2 password_hash example setting cost manually

Result: $2y$12$QjSH496pcT5CEbzjD/vtVeH03tfHKFy36d4J0Ltp3lRtee9HDxY3K
PHP Version:

Example #3 password_hash example finding a good cost

Result: Appropriate Cost Found: 10
PHP Version:

Example #4 password_hash example using Argon2i

Result: Argon2i hash: $argon2i$v=19$m=1024,t=2,p=2$YzJBSzV4TUhkMzc3d3laeg$zqU/1IN0/AogfP4cmSJI1vc8lpXRW9/S0sYY2i2jHT0
PHP Version:


Example #5 of password_hash

PHP Version:


Function password_hash:

Password Hashing Functions

Most used PHP functions