Last active
June 26, 2017 18:15
-
-
Save shahid249/c18bec6e9ffbef0b3dbeadbc640b5ed2 to your computer and use it in GitHub Desktop.
This code find specific value or words in arrary - PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This code find specific value or words in arrary | |
$array = array('unacceptword', 'unacceptword1', 'unacceptword2'); | |
$array1 = array('noteligible1', 'noteligible2', 'noteligible3'); | |
//here you can post your value by form method | '$_POST[username]' | |
$obtainvalue = 'noteligible1' ;//'$_POST[username]'; | |
if (in_array($obtainvalue, $array) || in_array($obtainvalue, $array1)){echo 'Not Acceptable';} | |
else if (in_array($obtainvalue, $array) || in_array($obtainvalue, $array1)){echo 'Not Eligible';} | |
?> | |
<!-- Your Form Data --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment