I am wondering if it is possible to search an array, with another array's values. So if there is 2 arrays, Array a and Array b - array a will see if its values as any results in array b.
define('L001', 'Wrong Password');
define('L002', 'Form not filled in');
define('L003', 'Account is not active');
$errors = array ('L001', 'L002', 'L003');
$args = explode('/', rtrim($_SERVER['QUERY_STRING'], '/'));
if (isset($args) && in_array($errors, $args)) {
if (in_array($errors[0], $args)) {
$error = L001;
} elseif (in_array($errors[1], $args)) {
$error = L002;
} elseif (in_array($errors[2], $args)) {
$error = L003;
}
} else {
//no errors
}
Is something like this possible?