← All built-ins / password_hash()
password_hash()
password_hash(string $s): string
Parameters
| Name | Type | Description |
|---|---|---|
| $password | string | plain password |
Return value
Storable hash string ($hphp$4096$salt$digest, PBKDF2-SHA256). The salt is random per call.
Example
$h = password_hash("correct horse");
echo strlen($h) > 40 && password_verify("correct horse", $h) ? "hash-ok" : "hash-bad";hash-ok