PHP 8.5.0 Beta 3 available for testing

FilesystemIterator::next

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

FilesystemIterator::next โ€” Move to the next file

่ฏดๆ˜Ž

public FilesystemIterator::next(): void

Move to the next file.

ๅ‚ๆ•ฐ

ๆญคๅ‡ฝๆ•ฐๆฒกๆœ‰ๅ‚ๆ•ฐใ€‚

่ฟ”ๅ›žๅ€ผ

ๆฒกๆœ‰่ฟ”ๅ›žๅ€ผใ€‚

็คบไพ‹

็คบไพ‹ #1 FilesystemIterator::next() example

List the contents of a directory using a while loop.

<?php
$iterator
= new FilesystemIterator(dirname(__FILE__));
while(
$iterator->valid()) {
echo
$iterator->getFilename() . "\n";
$iterator->next();
}
?>

ไปฅไธŠ็คบไพ‹็š„่พ“ๅ‡บ็ฑปไผผไบŽ๏ผš

apple.jpg
banana.jpg
example.php

ๅ‚่ง

๏ผ‹ๆทปๅŠ ๅค‡ๆณจ

็”จๆˆท่ดก็Œฎ็š„ๅค‡ๆณจ

ๆญค้กต้ขๅฐšๆ— ็”จๆˆท่ดก็Œฎ็š„ๅค‡ๆณจใ€‚
To Top