PHP: Hypertext Preprocessor (original) (raw)
Predefined Constants
The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.
[SEEK_SET](filesystem.constants.php#constant.seek-set)
(int)
[SEEK_CUR](filesystem.constants.php#constant.seek-cur)
(int)
[SEEK_END](filesystem.constants.php#constant.seek-end)
(int)
[LOCK_SH](filesystem.constants.php#constant.lock-sh)
(int)
[LOCK_EX](filesystem.constants.php#constant.lock-ex)
(int)
[LOCK_UN](filesystem.constants.php#constant.lock-un)
(int)
[LOCK_NB](filesystem.constants.php#constant.lock-nb)
(int)
Available flags
forfile()
[FILE_USE_INCLUDE_PATH](filesystem.constants.php#constant.file-use-include-path)
(int)
Search for filename
ininclude_path.
[FILE_NO_DEFAULT_CONTEXT](filesystem.constants.php#constant.file-no-default-context)
(int)
[FILE_APPEND](filesystem.constants.php#constant.file-append)
(int)
Append content to existing file.
[FILE_IGNORE_NEW_LINES](filesystem.constants.php#constant.file-ignore-new-lines)
(int)
Strip EOL characters.
[FILE_SKIP_EMPTY_LINES](filesystem.constants.php#constant.file-skip-empty-lines)
(int)
Skip empty lines.
[FILE_BINARY](filesystem.constants.php#constant.file-binary)
(int)
Binary mode.
Warning
This constant has no effect, and is deprecated as of PHP 8.1.0.
[FILE_TEXT](filesystem.constants.php#constant.file-text)
(int)
Text mode.
Warning
This constant has no effect, and is deprecated as of PHP 8.1.0.
Available flags
forglob()
[GLOB_AVAILABLE_FLAGS](filesystem.constants.php#constant.glob-available-flags)
(int)
All [GLOB_*](filesystem.constants.php#constant.glob-available-flags)
flags combined. Equivalent to 0
| [GLOB_BRACE](filesystem.constants.php#constant.glob-brace)
|[GLOB_MARK](filesystem.constants.php#constant.glob-mark)
| [GLOB_NOSORT](filesystem.constants.php#constant.glob-nosort)
|[GLOB_NOCHECK](filesystem.constants.php#constant.glob-nocheck)
| [GLOB_NOESCAPE](filesystem.constants.php#constant.glob-noescape)
|[GLOB_ERR](filesystem.constants.php#constant.glob-err)
| [GLOB_ONLYDIR](filesystem.constants.php#constant.glob-onlydir)
[GLOB_BRACE](filesystem.constants.php#constant.glob-brace)
(int)
Expands {a,b,c} to match 'a', 'b', or 'c'
Note:
[GLOB_BRACE](filesystem.constants.php#constant.glob-brace)
is not available on some non GNU systems, like Solaris or Alpine Linux.
[GLOB_ERR](filesystem.constants.php#constant.glob-err)
(int)
Stop on read errors (like unreadable directories), by default errors are ignored.
[GLOB_MARK](filesystem.constants.php#constant.glob-mark)
(int)
Adds a slash (a backslash on Windows) to each directory returned
[GLOB_NOCHECK](filesystem.constants.php#constant.glob-nocheck)
(int)
Return the search pattern if no files matching it were found
[GLOB_NOESCAPE](filesystem.constants.php#constant.glob-noescape)
(int)
Backslashes do not quote metacharacters
[GLOB_NOSORT](filesystem.constants.php#constant.glob-nosort)
(int)
Return files as they appear in the directory (no sorting). When this flag is not used, the pathnames are sorted alphabetically
[GLOB_ONLYDIR](filesystem.constants.php#constant.glob-onlydir)
(int)
Return only directory entries which match the pattern
Available flags
forpathinfo()
[PATHINFO_ALL](filesystem.constants.php#constant.pathinfo-all)
(int)
All parts of the pathinfo returned as an associative array.
[PATHINFO_DIRNAME](filesystem.constants.php#constant.pathinfo-dirname)
(int)
The path of the directory or file.
[PATHINFO_BASENAME](filesystem.constants.php#constant.pathinfo-basename)
(int)
The name of the directory or the name and extension of the file.
[PATHINFO_EXTENSION](filesystem.constants.php#constant.pathinfo-extension)
(int)
The extension of the file.
[PATHINFO_FILENAME](filesystem.constants.php#constant.pathinfo-filename)
(int)
The name of the file (without the extension) or directory.
Available scanner_mode
s forparse_ini_file() andparse_ini_string()
[INI_SCANNER_NORMAL](filesystem.constants.php#constant.ini-scanner-normal)
(int)
Normal INI scanner mode.
[INI_SCANNER_RAW](filesystem.constants.php#constant.ini-scanner-raw)
(int)
Raw INI scanner mode.
[INI_SCANNER_TYPED](filesystem.constants.php#constant.ini-scanner-typed)
(int)
Typed INI scanner mode.
Available flags
forfnmatch()
[FNM_NOESCAPE](filesystem.constants.php#constant.fnm-noescape)
(int)
Disable backslash escaping.
[FNM_PATHNAME](filesystem.constants.php#constant.fnm-pathname)
(int)
Slash in string only matches slash in the given pattern.
[FNM_PERIOD](filesystem.constants.php#constant.fnm-period)
(int)
Leading period in string must be exactly matched by period in the given pattern.
[FNM_CASEFOLD](filesystem.constants.php#constant.fnm-casefold)
(int)
Caseless match. Part of the GNU extension.
PHP File Upload Constants
[UPLOAD_ERR_CANT_WRITE](filesystem.constants.php#constant.upload-err-cant-write)
(int)
Failed to write file to disk. The value of the constant is 7
.
[UPLOAD_ERR_EXTENSION](filesystem.constants.php#constant.upload-err-extension)
(int)
A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop; examining the list of loaded extensions with phpinfo() may help. The value of the constant is 8
.
[UPLOAD_ERR_FORM_SIZE](filesystem.constants.php#constant.upload-err-form-size)
(int)
The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form. The value of the constant is 2
.
[UPLOAD_ERR_INI_SIZE](filesystem.constants.php#constant.upload-err-ini-size)
(int)
The uploaded file exceeds theupload_max_filesize directive in php.ini. The value of the constant is 1
.
[UPLOAD_ERR_NO_FILE](filesystem.constants.php#constant.upload-err-no-file)
(int)
No file was uploaded. The value of the constant is 4
.
[UPLOAD_ERR_NO_TMP_DIR](filesystem.constants.php#constant.upload-err-no-tmp-dir)
(int)
Missing a temporary folder. The value of the constant is 6
.
[UPLOAD_ERR_OK](filesystem.constants.php#constant.upload-err-ok)
(int)
There is no error, the file uploaded with success. The value of the constant is 0
.
[UPLOAD_ERR_PARTIAL](filesystem.constants.php#constant.upload-err-partial)
(int)
The uploaded file was only partially uploaded. The value of the constant is 3
.
Found A Problem?
There are no user contributed notes for this page.