NSA
sudo apt-get thefuckout.tar.gz
- Dec 9, 2011
- 715
- 86
Hello,
I'm not sure how to explain this, so I'll do my best!
So say I have 4 variables like this (or something like this)
$var[1];
$var[2];
$var[3];
$var[4];
I then want something like this:
if(preg_match('/[^0-9A-Za-z]/',$var[?])){
echo "error";
}else{
login($var[1], $var[2]);
}
So that each variable will be checked without having to write separate if statements for each variable and data will be passed through to the function.
How can I do this in PHP?
I'm not sure how to explain this, so I'll do my best!
So say I have 4 variables like this (or something like this)
$var[1];
$var[2];
$var[3];
$var[4];
I then want something like this:
if(preg_match('/[^0-9A-Za-z]/',$var[?])){
echo "error";
}else{
login($var[1], $var[2]);
}
So that each variable will be checked without having to write separate if statements for each variable and data will be passed through to the function.
How can I do this in PHP?