PHP Conference Japan 2024

SplFileInfo 類別

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

簡介

SplFileInfo 類別提供了一個高階物件導向的介面,用於存取個別檔案的資訊。

類別概要

class SplFileInfo implements Stringable {
/* 方法 */
public __construct(string $filename)
public getATime(): int|false
公開 getBasename(字串 $suffix = ""): 字串
公開 getPath(): 字串
公開 getSize(): 整數|false
公開 getType(): 字串|false
公開 isDir(): 布林值
公開 isFile(): 布林值
公開 isLink(): 布林值
公開 openFile(字串 $mode = "r", 布林值 $useIncludePath = false, ?資源 $context = null): SplFileObject
公開 setFileClass(字串 $class = SplFileObject::class):
公開 setInfoClass(字串 $class = SplFileInfo::class):
公開 __toString(): 字串
}

更新日誌

版本 說明
8.0.0 SplFileInfo 現在實作了 Stringable 介面。

目錄

新增註記

使用者提供的註記

此頁面沒有使用者提供的註記。
To Top