php 按條件進行計算的方法

2022-02-09 01:58:31 字數 741 閱讀 3645

$isin = in_array($sheng,$s_sheng);//

post過來的省的編碼是否在s_sheng(自定義的陣列)裡,如果在,則加一,如果不在則不加一

if($isin

)else

$result=90000;

$sheng_result=90000*2;

$leixing_result=90000*2+10000;

$leixing_result_else=90000+10000;

$isin = in_array($sheng,$s_sheng);//

post過來的省的編碼是否在s_sheng(自定義的陣列)裡,如果在,則加一,如果不在則不加一

if($isin

)else

}else

else

}

優化

$isin = in_array($sheng,$s_sheng);//

post過來的省的編碼是否在s_sheng(自定義的陣列)裡,如果在,則加一,如果不在則不加一

$inleixing = in_array($leixing,$s_leixing);//

post過來的省的編碼是否在s_sheng(自定義的陣列)裡,如果在,則加一,如果不在則不加一

if($isin

)else

}else

else

}echo "";

php 按條件進行計算的方法

isin in array sheng,s sheng post過來的省的編碼是否在s sheng 自定義的陣列 裡,如果在,則加一,如果不在則不加一 if isin else result 90000 sheng result 90000 2 leixing result 90000 2 1000...

php按位與條件匹配演算法

在條件固定的前提下,傳參想匹配多個條件,可以使用按位與進行匹配,具體如下 目標 狀態碼結果 匹配結果 紅色 index 1 foreach ary as key value html index.testnum.decbin testnum value.decbin value result.dec...

ExtJS4 按條件查詢的方法

grid的分頁查詢預設只是傳入了 start limit sort dir 等引數,如果需要傳入其他的引數 比如 控制項中的條件,可以按如下方法 1.條件引數是通過額外引數的方式傳遞到後台,所以 store 的url 不用去鳥,該怎麼寫就怎麼寫。var store ext.create ext.da...