Simpler way to check if variable is not equal to multiple string values?

前端 未结 7 1269
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 19:11

Current Codes:



        
7条回答
  •  情歌与酒
    2020-12-04 19:29

    You can make use of in_array() in PHP.

    $os = array("uk", "us"); // You can set multiple check conditions here
    if (in_array("uk", $os)) //Founds a match !
    {
        echo "Got you"; 
    }
    

提交回复
热议问题