SplFileInfo::__construct

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

SplFileInfo::__construct构造新的 SplFileInfo 对象

说明

public SplFileInfo::__construct(string $filename)

为指定 file_name 创建新的 SplFileInfo 对象。该文件不需要存在或者可读。

参数

filename

文件路径。

示例

示例 #1 SplFileInfo::__construct() 示例

<?php
$info
= new SplFileInfo('example.php');
if (
$info->isFile()) {
echo
$info->getRealPath();
}
?>

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top