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

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

<tfoot id='Ldm8G'></tfoot>

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

      1. 在 foreach 中,isLastItem() 存在嗎?

        in foreach, isLastItem() exists?(在 foreach 中,isLastItem() 存在嗎?)
          <tbody id='SYpyn'></tbody>

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

        <tfoot id='SYpyn'></tfoot>

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

                • 本文介紹了在 foreach 中,isLastItem() 存在嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  使用常規的 for 循環,可以將當前索引與最后一個進行比較,以判斷我是否處于循環的最后一次迭代中.使用 foreach 時是否有類似的事情?我的意思是這樣的.

                  Using a regular for loop, it's possible to comapred the current index with the last to tell if I'm in the last iteration of the loop. Is there a similar thing when using foreach? I mean something like this.

                  foreach($array as $item){
                    //do stuff
                    //then check if we're in the last iteration of the loop
                    $last_iteration = islast(); //boolean true/false
                  }
                  

                  如果沒有,是否至少有一種方法可以知道當前迭代的當前索引,例如 $iteration = 5,以便我可以手動將其與 $array 的長度進行比較?

                  If not, is there at least a way to know the current index of the current iteration like $iteration = 5, so I can manually compare it to the length of the $array?

                  推薦答案

                  您可以組合使用 SPL 的 >ArrayIteratorCachingIterator 類有一個 hasNext 方法:

                  You can use a combination of SPL’s ArrayIterator and CachingIterator class to have a hasNext method:

                  $iter = new CachingIterator(new ArrayIterator($arr));
                  foreach ($iter as $value) {
                      $last_iteration = !$iter->hasNext();
                  }
                  

                  這篇關于在 foreach 中,isLastItem() 存在嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準備好的語句amp;foreach 循環)
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數)
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“localhost的訪問被拒絕)
                • <tfoot id='rbKxR'></tfoot>
                  <i id='rbKxR'><tr id='rbKxR'><dt id='rbKxR'><q id='rbKxR'><span id='rbKxR'><b id='rbKxR'><form id='rbKxR'><ins id='rbKxR'></ins><ul id='rbKxR'></ul><sub id='rbKxR'></sub></form><legend id='rbKxR'></legend><bdo id='rbKxR'><pre id='rbKxR'><center id='rbKxR'></center></pre></bdo></b><th id='rbKxR'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rbKxR'><tfoot id='rbKxR'></tfoot><dl id='rbKxR'><fieldset id='rbKxR'></fieldset></dl></div>
                  • <bdo id='rbKxR'></bdo><ul id='rbKxR'></ul>
                    <legend id='rbKxR'><style id='rbKxR'><dir id='rbKxR'><q id='rbKxR'></q></dir></style></legend>

                          <tbody id='rbKxR'></tbody>
                        1. <small id='rbKxR'></small><noframes id='rbKxR'>

                            主站蜘蛛池模板: 欧美一级免费看 | 日韩不卡一区二区三区 | 天天干天天爱天天爽 | 成人精品在线视频 | 久久久青草婷婷精品综合日韩 | 国产h视频 | 国产精品欧美一区二区 | 欧美日韩中文在线 | 色网在线观看 | 日韩超碰在线 | 亚洲视频一区二区三区 | 亚洲综合大片69999 | 欧美区日韩区 | 91人人澡人人爽 | 欧美成年网站 | 日本在线一区二区 | 黄色毛片免费看 | 国产午夜精品久久 | 欧美一区二区三区在线播放 | 亚洲乱码国产乱码精品精的特点 | 中文在线a在线 | 99国产精品久久久久 | 国产精品精品视频一区二区三区 | 日韩av电影在线观看 | 国产精品成人一区二区三区夜夜夜 | 国产一级片av | 中文字幕第十五页 | 97精品超碰一区二区三区 | 国产精品欧美一区二区 | 日本午夜精品 | 五月婷婷在线视频 | 黄色片视频网站 | 久久久精品一区 | 亚洲乱码一区二区三区在线观看 | 国家aaa的一级看片 h片在线看 | 色悠悠久 | 蜜桃精品视频在线 | 国产视频中文字幕 | 久久久美女 | 天天天操操操 | 伊人99 |