How do you use bcrypt for hashing passwords in PHP?

use password_hash() to create a bcrypt hash of any password:
password_hash('yourPassword', PASSWORD_DEFAULT);
use password_hash() to create a bcrypt hash of any password with option:
$options = ['cost' => 11];
password_hash('yourPassword', PASSWORD_BCRYPT, $options)
To verify a user provided password against an existing hash, you may use the password_verify() as such:
$hash = '$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq';
password_verify('yourPassword', $hash)