php擷取數組的最後一個元素_PHP教程

來源:互聯網
上載者:User

php擷取數組的最後一個元素


php擷取數組的最後一個元素的方法。使用php內建函數end()。

end() 函數將數組內部指標指向最後一個元素,並返回該元素的值(如果成功)。例如:

$args=Array('www','phpernote','com');echo end($args);//com

您可能感興趣的文章

  • js擷取數組的最後一個元素
  • php如何刪除數組的第一個元素和最後一個元素
  • php清除數組中的空值元素
  • php擷取數組第一個數組單元值的方法
  • php在數組中尋找某個值是否存在(in_array(),array_search(),array_key_exists())
  • PHP判斷兩個數組是否存在交集
  • php將多維陣列轉換為一維數組的辦法
  • 關於使用in_array() foreach array_search() 尋找數組是否包含時的效能對比

http://www.bkjia.com/PHPjc/858905.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/858905.htmlTechArticlephp擷取數組的最後一個元素 php擷取數組的最後一個元素的方法。使用php內建函數end()。 end() 函數將數組內部指標指向最後一個元素,並返回...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.