/* Password. */ $password = 'my secret password'; /* Set the "cost" parameter to 12. */ $options = ['cost' => 12]; /* Create the hash. */ $hash = password_hash($password, PASSWORD_DEFAULT, $options);