if ($_POST["password"] === $_POST["confirm_password"]) {    // success! } else {    // failed 😦 }

Read more of this post