略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SplFileInfo::__construct

2024-05-10

SplFileInfo::__construct

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

SplFileInfo::__construct构建一个新的 SplFileInfo 对象

说明

public SplFileInfo::__construct(string $file_name)

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

参数

file_name

文件路径

范例

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

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

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/splfileinfo.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3