如何在这个平等的陈述中添加第二个条件?

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.

Just use the logical and operator &&. You can also use and if you prefer, but && is more in use. The only difference between the two is operator precedence.

if ($onevariable === $othervariable && $2variable === $2othervariable) {
    require("file.php");
}

You can use a simple && operator:

if ( $onevariable === $othervariable && $2variable === $2othervariable ) {
  require("file.php");
}

You do this with &&

if ( $onevariable === $othervariable && $2variable === $2othervariable) {

You can read more about logical operators here.

You can Directly use the && operator like this

if ( $onevariable === $othervariable && $2variable ===$2othervariable )
{
  require("file.php");
}

further You can visit here