PHP 快速導覽 - 核心延伸函數 目錄相關 scandir()





































PHP 快速導覽 - 核心延伸函數 目錄相關 scandir()






內建函數 (function) scandir() 將目錄路徑資料回傳為陣列










函數說明
array scandir(string $directory [, int $sorting_order = SCANDIR_SORT_ASCENDING [, resource $context]])$directory 為目錄路徑。



參數 (parameter) 為目錄路徑,須注意回傳的是陣列。


舉例如下
<?php
$d = scandir('./example/');
print_r($d);

/* 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:dir05.php
功能:示範 PHP 程式
作者:張凱慶
時間:西元 2013 年 2 月 */
?>



執行結果如下















中英文術語對照
函數function
參數parameter



您可以繼續參考
目錄相關

  • chdir()

  • closedir()

  • dir()

  • getcwd()

  • opendir()

  • readdir()

  • rewinddir()

  • scandir()





相關目錄

回 PHP 快速導覽
回 PHP 教材
回首頁



參考資料

http://www.php.net/manual/en/function.scandir.php







沒有留言:




















window.___gcfg = { 'lang': 'zh-TW' };





Popular posts from this blog

Mái uốn xoăn như “bà thím” vẫn được loạt sao Hàn yêu thích, nhờ sự thay đổi này mà ai cũng trẻ trung hơn hẳn

Cô bé "The Voice Kids Anh" nhận ngay nút vàng tại "Got Talent Mỹ" với màn trình diễn quá đáng yêu

Học trò của Minh Tú và "chị đại" Lukkade bất ngờ đóng MV chung với nhau