php檔案操作函數有哪些?

來源:互聯網
上載者:User
  1. /*
  2. * 1、擷取路徑的檔案名稱
  3. * string basename(string path[,string suffix])
  4. * 2、擷取路徑的目錄
  5. * string dirname(string path)
  6. * 3、瞭解更多的路徑資訊
  7. * array pathinfo(string path)
  8. * 4、確定絕對路徑
  9. * string realpath(string path)
  10. * 5、確定檔案的大小
  11. * int filesize(string filename)
  12. * 6、計算磁碟的可用空間
  13. * float disk_free_space(string directory)
  14. * 7、計算磁碟的總容量
  15. * float disk_total_space(string directory)
  16. * 8、確定檔案的最後訪問時間
  17. * int fileatime(string filename)
  18. * 9、確定檔案的最後改變時間
  19. * int filectime(string filename)
  20. * 10、確定檔案的最後修改時間
  21. * int filemtime(string filename)
  22. * 11、識別檔案末尾字元
  23. * int feof(string resource)
  24. * 12、開啟和關閉檔案
  25. * resource fopen(string resource,string mode[,int use_include_path[,resource zountext]])
  26. * boolean fclose(resource filehandle)
  27. * 13、將檔案讀入數組
  28. * array file9string filename[,int user_inlucde_path[,resource context]])
  29. * 14、將檔案內容讀入字串變數
  30. * string file_get_contents(string filename[,int use_inlude_path[resource context]])
  31. * 15、將CSV檔案讀入數組
  32. * array fgetcsv(resource handle[,int length[,string delimiter[,string enclosure]]])
  33. * 16、讀取指定數目的字元
  34. * string fgets(resource handle[,int length])
  35. * 17、從輸入中剔除標記,清除所有HTML和PHP標記
  36. * string fgetss(resourcce handle,int length[,string allowable_tags])
  37. * 18、以一次讀取一個字元的方式讀取檔案
  38. * string fgetc(resource handle)
  39. * 19、忽略分行符號
  40. * string freed(resource handle,int length)
  41. * 20、讀取整個檔案
  42. * int readfile(string filename[,int use_include_path])
  43. * 21、根據預定義的格式讀取檔案
  44. * mixed fscanf(resource handle,string format[,string var1])
  45. * 22、將字串寫入檔案
  46. * int fwrite(resource handle,string string[,int length])
  47. * 23、移動檔案指標
  48. * int fseek(resource handle,int offset[,int whence])
  49. *
  50. * 1、開啟目錄控制代碼
  51. * resource opendir(string path)
  52. * 2、關閉目錄控制代碼
  53. * void closedir(resource directory_handle)
  54. * 3、解析目錄內容
  55. * string readdir(resource directory_handle)
  56. * 4、將目錄讀入數組
  57. * array scandir(string directory[,int sorting_order[,resource context]])
  58. *
  59. *
  60. * 1、刪除目錄
  61. * int rmdir(string dirname)
  62. * 2、重新命名檔案
  63. * boolean rename(string olename,string newname)
  64. * 3、觸摸檔案
  65. * int touch(sting filename[,int time[,int atime]])
  66. */
複製代碼
  • 聯繫我們

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