久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php怎么判斷數(shù)組值存不存在

      在php中,可以使用in_array()函數(shù)來判斷數(shù)組值存不存在,該函數(shù)的作用是搜索數(shù)組中是否存在指定的值,語法“in_array(search,array,type)”;如果值存在則返回TRUE,否則返回FALSE。

      php怎么判斷數(shù)組值存不存在

      本教程操作環(huán)境:windows7系統(tǒng)、PHP7.1版、DELL G3電腦

      在php中,可以使用in_array()函數(shù)來判斷數(shù)組值存不存在。

      in_array() 函數(shù)可以搜索數(shù)組中是否存在指定的值。

      語法:

      in_array(search,array,type)
      • search 必需。規(guī)定要在數(shù)組搜索的值。

      • array 必需。規(guī)定要搜索的數(shù)組。

      • type 可選。如果設(shè)置該參數(shù)為 true,則檢查搜索的數(shù)據(jù)與數(shù)組的值的類型是否相同。

      返回值:如果在數(shù)組中找到值則返回 TRUE,否則返回 FALSE。

      說明:

      • 如果 search 參數(shù)是字符串且 type 參數(shù)被設(shè)置為 TRUE,則搜索區(qū)分大小寫。

      • 如果給定的值 search 存在于數(shù)組 array 中則返回 true。如果第三個(gè)參數(shù)設(shè)置為 true,函數(shù)只有在元素存在于數(shù)組中且數(shù)據(jù)類型與給定值相同時(shí)才返回 true。

      • 如果沒有在數(shù)組中找到參數(shù),函數(shù)返回 false。

      示例:判斷數(shù)組值"Glenn" 存不存在

      <?php header("Content-type:text/html;charset=utf-8"); $people = array("Bill", "Steve", "Mark", "David");  if (in_array("Mark", $people))   {   echo "指定值存在";   } else   {   echo "指定值不存在";   } ?>

      php怎么判斷數(shù)組值存不存在

      推薦學(xué)習(xí):《PHP視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)