略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: streamWrapper::url_stat

2024-12-20

streamWrapper::url_stat

(PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8)

streamWrapper::url_statRetrieve information about a file

参数

path

The file path or URL to stat. Note that in the case of a URL, it must be a :// delimited URL. Other URL forms are not supported.

flags

Holds additional flags set by the streams API. It can hold one or more of the following values OR'd together.

Flag Description
STREAM_URL_STAT_LINK For resources with the ability to link to other resource (such as an HTTP Location: forward, or a filesystem symlink). This flag specified that only information about the link itself should be returned, not the resource pointed to by the link. This flag is set in response to calls to lstat(), is_link(), or filetype().
STREAM_URL_STAT_QUIET If this flag is set, your wrapper should not raise any errors. If this flag is not set, you are responsible for reporting errors using the trigger_error() function during stating of the path.

返回值

Should return an array with the same elements as stat() does. Unknown or unavailable values should be set to a rational value (usually 0). Special attention should be payed to mode as documented under stat(). Should return false on failure.

错误/异常

调用此方法失败将给出 E_WARNING(未实现)。

注释

注意:

当合法的上下文传递给调用函数时,属性 streamWrapper::$context 会被改变。

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/streamwrapper.url-stat.php

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