20160718-0722工作記錄

請繼續研究這個問題,用in_array()倒底&&和||都適用嗎?

同時判斷的疑問
Simpler way to check if variable is not equal to multiple string values?
<?php
if ("$page_id" !== '2' || "$page_id" !== '8')
//等同
if (! ("$page_id" == '2' || "$page_id" == '8') )

if( $some_variable !== 'uk' && $some_variable !== 'us' )

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