How can PHP developers verify passwords with double salted hashes effectively?

When verifying passwords with double salted hashes in PHP, developers can concatenate the password with both salts, hash the result, and compare it to the stored hash value. This ensures that both salts are used in the verification process, making it more secure.

$password = "password123";
$salt1 = "randomsalt1";
$salt2 = "randomsalt2";
$storedHash = "hashedpassword"; // Retrieve the stored hash from the database

$combinedSalt = $password . $salt1 . $salt2;
$hashedPassword = hash('sha256', $combinedSalt);

if ($hashedPassword === $storedHash) {
    echo "Password is correct";
} else {
    echo "Password is incorrect";
}