如何使用许多“或”运算符优化if请求? [重复]

This question already has an answer here:

Is there a way to reduce the code if I have many "ands" and "ands" in my if request for the same value? I would like to need $row['animal'] only one time:

  if ($row['animal'] == "cat") or 
     ($row['animal'] == "dog") or 
     ($row['animal'] == "bird") or 
     ($row['animal'] == "monkey") or 
     ($row['animal'] == "mouse") or 
     ($row['animal'] == "hedgehog"){
     echo "many animals";}
</div>
echo in_array($row['animal'], array('cat', 'dog', 'bird', 'monkey', 'mouse','hedgehog'))
      ? 'many animals' 
      : 'no animals';