Skip to content

Instantly share code, notes, and snippets.

@elliotwms
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elliotwms/ba558a6699d4c709919f to your computer and use it in GitHub Desktop.
Save elliotwms/ba558a6699d4c709919f to your computer and use it in GitHub Desktop.
<form id="youdeservearrays" action="index.php" method="post">
<input type="password" name="password[1]" value="Hello World">
<input type="password" name="password[2]" value="Hello Qorld">
</form>
<?php
if (count(array_unique($_POST['password'])) == 1) {
$password = $_POST['password'][0];
} else {
echo "Passwords didn't match!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment