久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='RW2iP'><tr id='RW2iP'><dt id='RW2iP'><q id='RW2iP'><span id='RW2iP'><b id='RW2iP'><form id='RW2iP'><ins id='RW2iP'></ins><ul id='RW2iP'></ul><sub id='RW2iP'></sub></form><legend id='RW2iP'></legend><bdo id='RW2iP'><pre id='RW2iP'><center id='RW2iP'></center></pre></bdo></b><th id='RW2iP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RW2iP'><tfoot id='RW2iP'></tfoot><dl id='RW2iP'><fieldset id='RW2iP'></fieldset></dl></div>

  1. <small id='RW2iP'></small><noframes id='RW2iP'>

    • <bdo id='RW2iP'></bdo><ul id='RW2iP'></ul>
    <tfoot id='RW2iP'></tfoot>
    1. <legend id='RW2iP'><style id='RW2iP'><dir id='RW2iP'><q id='RW2iP'></q></dir></style></legend>

      PHP foreach 只返回鍵

      PHP foreach that returns keys only(PHP foreach 只返回鍵)

      <legend id='dZ3DS'><style id='dZ3DS'><dir id='dZ3DS'><q id='dZ3DS'></q></dir></style></legend>

          <tbody id='dZ3DS'></tbody>
          <bdo id='dZ3DS'></bdo><ul id='dZ3DS'></ul>
            • <tfoot id='dZ3DS'></tfoot>
              <i id='dZ3DS'><tr id='dZ3DS'><dt id='dZ3DS'><q id='dZ3DS'><span id='dZ3DS'><b id='dZ3DS'><form id='dZ3DS'><ins id='dZ3DS'></ins><ul id='dZ3DS'></ul><sub id='dZ3DS'></sub></form><legend id='dZ3DS'></legend><bdo id='dZ3DS'><pre id='dZ3DS'><center id='dZ3DS'></center></pre></bdo></b><th id='dZ3DS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dZ3DS'><tfoot id='dZ3DS'></tfoot><dl id='dZ3DS'><fieldset id='dZ3DS'></fieldset></dl></div>

                <small id='dZ3DS'></small><noframes id='dZ3DS'>

              1. 本文介紹了PHP foreach 只返回鍵的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問題描述

                可能沒有任何意義但仍然可能有一個(gè)聰明的答案的理論問題.

                Theoretical question that perhaps does not make any sense but still, maybe there is a clever answer.

                我想遍歷數(shù)組并獲取它的鍵和帶有它們的東西.我所做的一個(gè)簡(jiǎn)單的例子:

                I want to iterate through array and get its keys and to something with them. A quick example of what I do:

                foreach($array as $key => $value) {
                    $other_array[$key] = 'something';
                }
                

                現(xiàn)在,PHP Mess Detector 尖叫著 $value 在此范圍內(nèi)未使用.因此,我在想,這可能不是訪問我的 arraykeys 的最佳方式.

                Now, PHP Mess Detector screams that $value is unused in this scope. Therefore I was thinking that perhaps this is not the best way to access keys of my array.

                知道如何在不不必要地從我的 array 中取出 values 的情況下做到這一點(diǎn)嗎?它是否有任何顯著的性能影響......或者我可能只是偏執(zhí),應(yīng)該繼續(xù)而不用浪費(fèi)任何人的時(shí)間來(lái)回答愚蠢的問題:)

                Any idea how to do it without unnecessarily taking out values out of my array? Does it have any significant performance impact ... or perhaps I am just being paranoid and should carry on without wasting anyone's time with stupid questions :).

                推薦答案

                你可以這樣做

                foreach(array_keys($array) as $key) {
                 // do your stuff
                }
                

                這將使 foreach 迭代由數(shù)組中的鍵而不是實(shí)際數(shù)組組成的數(shù)組.請(qǐng)注意,從性能的角度來(lái)看,它可能不會(huì)更好.

                That would make the foreach iterate over an array consisting of the keys from your array instead of the actual array. Note that it's probably not better from a performance standpoint though.

                這篇關(guān)于PHP foreach 只返回鍵的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                MySQLi prepared statement amp; foreach loop(MySQLi準(zhǔn)備好的語(yǔ)句amp;foreach 循環(huán))
                Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個(gè)服務(wù)器還是從同一用戶獲取記錄?)
                PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無(wú)法識(shí)別登錄信息)
                mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個(gè)參數(shù))
                Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結(jié)果填充變量)
                MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“l(fā)ocalhost的訪問被拒絕)

                    <legend id='ZiRfV'><style id='ZiRfV'><dir id='ZiRfV'><q id='ZiRfV'></q></dir></style></legend>
                  1. <i id='ZiRfV'><tr id='ZiRfV'><dt id='ZiRfV'><q id='ZiRfV'><span id='ZiRfV'><b id='ZiRfV'><form id='ZiRfV'><ins id='ZiRfV'></ins><ul id='ZiRfV'></ul><sub id='ZiRfV'></sub></form><legend id='ZiRfV'></legend><bdo id='ZiRfV'><pre id='ZiRfV'><center id='ZiRfV'></center></pre></bdo></b><th id='ZiRfV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZiRfV'><tfoot id='ZiRfV'></tfoot><dl id='ZiRfV'><fieldset id='ZiRfV'></fieldset></dl></div>

                    <small id='ZiRfV'></small><noframes id='ZiRfV'>

                      <bdo id='ZiRfV'></bdo><ul id='ZiRfV'></ul>

                          <tbody id='ZiRfV'></tbody>
                        <tfoot id='ZiRfV'></tfoot>

                        • 主站蜘蛛池模板: 久久51| 亚洲综合无码一区二区 | 日韩高清电影 | 四虎影院在线观看免费视频 | 天堂国产 | 国产精品特级毛片一区二区三区 | 天天天操天天天干 | 久久久免费精品 | 黄色毛片视频 | 日韩中出 | 日韩黄色小视频 | 欧美日韩久久 | 国产精品成人国产乱一区 | 国产成人99久久亚洲综合精品 | 天天看逼| 粉嫩一区二区三区性色av | 人人做人人澡人人爽欧美 | 精品国产女人 | 最新国产在线 | 精品国产一区二区国模嫣然 | 九九久久久 | 91精品亚洲 | 亚洲视频在线播放 | 精品国产伦一区二区三区观看体验 | 偷牌自拍 | 91亚洲国产成人精品一区二三 | 免费大黄视频 | 久热精品在线观看视频 | 一级欧美视频 | 粉嫩国产精品一区二区在线观看 | 日韩二区 | 凹凸日日摸日日碰夜夜 | 精品一区二区三区在线观看 | 情侣黄网站免费看 | 久久精品欧美一区二区三区不卡 | 婷婷精品| 日日骚网| 韩国理论电影在线 | 久久精品一区二区 | 亚洲日韩欧美一区二区在线 | 国产精品一区二区久久久久 |