• <b id="l3qpx"><abbr id="l3qpx"></abbr></b>
  • <th id="l3qpx"><progress id="l3qpx"></progress></th>
      <th id="l3qpx"></th>
      <dd id="l3qpx"><font id="l3qpx"></font></dd>
      <th id="l3qpx"></th>
      0712-2888027 189-8648-0214
      微信公眾號

      孝感風(fēng)信網(wǎng)絡(luò)科技有限公司微信公眾號

      當(dāng)前位置:主頁 > 技術(shù)支持 > PHP > php中返回數(shù)組中的鍵名使用array_keys函數(shù)

      php中返回數(shù)組中的鍵名使用array_keys函數(shù)

      時間:2016-01-28來源:風(fēng)信官網(wǎng) 點(diǎn)擊: 959次
      array_keys — 返回數(shù)組中所有的鍵名

      說明 array array_keys ( array $input [, mixed $search_value = NULL [, bool $strict = false ]] )
      array_keys() 返回 input 數(shù)組中的數(shù)字或者字符串的鍵名。

      如果指定了可選參數(shù) search_value,則只返回該值的鍵名。否則 input 數(shù)組中的所有鍵名都會被返回。

      參數(shù)
      input一個數(shù)組,包含了要返回的鍵。

      search_value如果指定了這個參數(shù),只有包含這些值的鍵才會返回。

      strict判斷在搜索的時候是否該使用嚴(yán)格的比較(===)。


      返回值 返回 input 里的所有鍵。

      范例

      Example #1 array_keys() 例子

      <?php
      $array = array(0 => 100, "color" => "red");
      print_r(array_keys($array));

      $array = array("blue", "red", "green", "blue", "blue");
      print_r(array_keys($array, "blue"));

      $array = array("color" => array("blue", "red", "green"),
                     "size"  => array("small", "medium", "large"));
      print_r(array_keys($array));
      ?>
      以上例程會輸出:

      Array
      (
          [0] => 0
          [1] => color
      )
      Array
      (
          [0] => 0
          [1] => 3
          [2] => 4
      )
      Array
      (
          [0] => color
          [1] => size
      )
      熱門關(guān)鍵詞: php 數(shù)組 鍵名 array_keys函數(shù)
      欄目列表
      推薦內(nèi)容
      熱點(diǎn)內(nèi)容
      展開
      欧美一区二区三区免费A级视频,亚洲精品中文字幕综合,动漫精品中文字幕无码第一页,1024亚洲国产综合 亚太影院 柯西贝尔-游戏赚网
    1. <b id="l3qpx"><abbr id="l3qpx"></abbr></b>
    2. <th id="l3qpx"><progress id="l3qpx"></progress></th>
        <th id="l3qpx"></th>
        <dd id="l3qpx"><font id="l3qpx"></font></dd>
        <th id="l3qpx"></th>