phpのcurrent関数の使い方は何ですか?

current()関数は、配列の現在の要素の値を返すために使用されます。この関数を呼び出す前に、reset()関数を使用して配列の内部ポインタを最初の要素に向ける必要があります。

文法:

current(array)

彼女はとても忙しいので、時間がないと言っている。

$colors = array("red", "green", "blue");

echo current($colors); // 输出:red
next($colors);
echo current($colors); // 输出:green
コメントを残す 0

Your email address will not be published. Required fields are marked *


广告
広告は10秒後に閉じます。
bannerAds