<?php
$password = 'nilpointer.net';
$hash = sha1($password);
echo 'password: '.$password;
echo '<br>hash: '.$hash;
$input_password = 'nilpointer.net';
if($hash == sha1($input_password)) {
echo '<br>Password is Valid';
} else {
echo '<br>Invalid Password';
}
?>
Output
password: nilpointer.net
hash: b70c317d941cbefcd93aef04f08b1a876b1d4fb8
Password is Valid