Returns an array of files and directories from the directory. If directory is not a directory, then boolean FALSE is returned, and an error of level E_WARNING is generated.
By default, the sorted order is alphabetical in ascending order. If the optional sorting_order is used (set to 1), then sort order is alphabetical in descending order.
For a description of the context parameter, refer to CXX, Stream Functions Referencia .
Megjegyzés: A context támogatása a PHP 5.0.0 változattól felfele érhető el.
Példa 2. PHP 4 alternatives to scandir()
A fenti példa valami ilyesmi kimenetet ad:
|
Tipp: URL-t is megadhatsz az állomány név paraméter helyén ha a fopen wrappers szolgáltatás be van kapcsolva. Bővebb információk az fopen() leírásánál olvashatóak arról, milyen módon adhatod meg a fájlneveket, valamint érdemes megtekinteni a L Függelék oldalt a támogatott URL típusok listájának megtekintése gyanánt.
See also opendir(), readdir(), glob(), is_dir(), and sort().