php next 函數

來源:互聯網
上載者:User

next
( PHP 4中, PHP 5中)

next-推進內部數組指標數組

描述
mixed next ( array &$array )
未來( )的行為就像目前的( ) ,其中差異。它推動內部數組指標的一個地方提出,然後返回元素的值。這意味著在未來的回報價值和進步陣列的內部數組指標之一。

參數

陣列
數組受到影響。


傳回值
返回數組中的值其次是指出的內部數組指標,或FALSE如果沒有更多的內容。

警告
這個功能可能會返回布爾錯誤的,而且還可以返回一個非布爾值的計算為false ,如0或“ ” 。請仔細閱讀部分布爾以擷取更多資訊。使用===操作符進行測試的傳回值這一職能。

執行個體

例如# 1例使用下( )和朋友

<?php
$transport = array('foot', 'bike', 'car', 'plane');
$mode = current($transport); // $mode = 'foot';
$mode = next($transport);    // $mode = 'bike';
$mode = next($transport);    // $mode = 'car';
$mode = prev($transport);    // $mode = 'bike';
$mode = end($transport);     // $mode = 'plane';
?>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.