I am using this snippet below, how can i add a second equal statement with an "and" so something like ($onevariable === $othervariable) and ($2variable ===$2othervariable)
if ( $onevariable === $othervariable ) {
require("file.php");
}
I am using this snippet below, how can i add a second equal statement with an "and" so something like ($onevariable === $othervariable) and ($2variable ===$2othervariable)
if ( $onevariable === $othervariable ) {
require("file.php");
}
This is fairly straight-forward, it's just how you already wrote in your question:
if ( ($onevariable === $othervariable) and ($2variable === $2othervariable) ) {
require("file.php");
}
See as well Logical Operators (PHP).
Note: $2variable
is not a valid variable name, as well isn't $2othervariable
because they start with a number. But I think you get the idea from the example code.