Учебник по PHP

PHP ГЛАВНАЯ Введение в PHP Установка PHP Синтаксис PHP Комментарии PHP PHP-переменные PHP-эхо/печать Типы данных PHP PHP-строки PHP-номера PHP-математика PHP-константы PHP-операторы PHP Если... Иначе... Иначе PHP-переключатель PHP-циклы PHP-функции PHP-массивы PHP-суперглобальные переменные PHP регулярное выражение

PHP- формы

Обработка форм PHP Проверка формы PHP Требуется PHP-форма URL-адрес формы PHP/электронная почта PHP-форма завершена

PHP продвинутый

Дата и время PHP PHP включает Обработка файлов PHP Открытие/чтение файла PHP Создание/запись файла PHP Загрузка файла PHP PHP-куки PHP-сессии PHP-фильтры Расширенные фильтры PHP Функции обратного вызова PHP PHP JSON Исключения PHP

PHP ООП

PHP Что такое ООП PHP-классы/объекты PHP-конструктор PHP-деструктор Модификаторы доступа PHP Наследование PHP PHP-константы Абстрактные классы PHP PHP-интерфейсы Особенности PHP Статические методы PHP Статические свойства PHP Пространства имен PHP Итерации PHP

База данных MySQL

База данных MySQL Подключиться к MySQL MySQL Создать БД MySQL Создать таблицу Вставка данных MySQL MySQL Получить последний идентификатор MySQL Вставить несколько MySQL подготовлен Выбор данных MySQL MySQL Где Порядок MySQL MySQL Удалить данные Данные обновления MySQL Предельные данные MySQL

PHP XML

XML-парсеры PHP Парсер PHP SimpleXML PHP SimpleXML — Получить PHP XML Expat PHP XML DOM

PHP — АЯКС

Введение в АЯКС АЯКС PHP База данных AJAX АЯКС XML AJAX-поиск в реальном времени АЯКС-опрос

Примеры PHP

Примеры PHP PHP-компилятор PHP-викторина PHP-упражнения PHP-сертификат

Справочник по PHP

Обзор PHP PHP-массив Календарь PHP Дата PHP PHP-каталог Ошибка PHP PHP-исключение Файловая система PHP
базовое имя() чгрп() chmod() чаун() очистить кеш() копировать() Удалить() имя_каталога() disk_free_space() disk_total_space() свободное пространство на диске () fclose() feof() смывать() fgetc() fgetcsv() fgets() fgetss() файл() Файл существует() file_get_contents() file_put_contents() файлвремя () filectime() файловая группа() файлинод() файлвремя() владелец файла() файловые разрешения () размер файла() тип файла() стадо() fnmatch() fopen() fpassthru() fputcsv() fputs() fread() фсканф() fseek() Фстат() ftell() урезать () fwrite() глобус() is_dir() is_executable() is_file() is_link() is_readable() is_uploaded_file() is_writable() is_writeable() лчгрп() lchown() ссылка на сайт() информация о ссылке () lstat() мкдир() move_uploaded_file() parse_ini_file() parse_ini_string() информация о пути () закрыть() открыть() прочитать файл() ссылка для чтения() реальный путь() реальный путь_cache_get() реальный_кэш_размер() переименовать() перематывать() rmdir() set_file_buffer() статистика() символическая ссылка() временное имя() tmpfile() трогать() umask() развязать()
PHP-фильтр PHP FTP PHP JSON Ключевые слова PHP PHP-библиотека XML PHP-почта PHP-математика PHP Разное PHP MySQLi PHP-сеть Управление выводом PHP PHP регулярное выражение PHP SimpleXML PHP-поток PHP-строка Обработка переменных PHP XML-парсер PHP PHP-архив Часовые пояса PHP

Функции файловой системы PHP


Введение в файловую систему PHP

Функции файловой системы позволяют вам получать доступ к файловой системе и управлять ею.


Установка

Функции файловой системы являются частью ядра PHP. Для использования этих функций установка не требуется.


Совместимость с Unix/Windows

При указании пути на платформах Unix в качестве разделителя каталогов используется косая черта (/).

На платформах Windows можно использовать как прямую косую черту (/), так и обратную косую черту (\).


Конфигурация среды выполнения

На поведение функций файловой системы влияют настройки в php.ini.

Name Default Description Changeable
allow_url_fopen "1" Allows fopen()-type functions to work with URLs PHP_INI_SYSTEM
allow_url_include "0" (available since PHP 5.2) PHP_INI_SYSTEM
user_agent NULL Defines the user agent for PHP to send (available since PHP 4.3) PHP_INI_ALL
default_socket_timeout "60" Sets the default timeout, in seconds, for socket based streams (available since PHP 4.3) PHP_INI_ALL
from "" Defines the email address to be used on unauthenticated FTP connections and in the From header for HTTP connections when using ftp and http wrappers PHP_INI_ALL
auto_detect_line_endings "0" When set to "1", PHP will examine the data read by fgets() and file() to see if it is using Unix, MS-Dos or Mac line-ending characters (available since PHP 4.3) PHP_INI_ALL
sys_temp_dir "" (available since PHP 5.5) PHP_INI_SYSTEM


Функции файловой системы PHP

Function Description
basename() Returns the filename component of a path
chgrp() Changes the file group
chmod() Changes the file mode
chown() Changes the file owner
clearstatcache() Clears the file status cache
copy() Copies a file
delete() See unlink()
dirname() Returns the directory name component of a path
disk_free_space() Returns the free space of a filesystem or disk
disk_total_space() Returns the total size of a filesystem or disk
diskfreespace() Alias of disk_free_space()
fclose() Closes an open file
feof() Checks if the "end-of-file" (EOF) has been reached for an open file
fflush() Flushes buffered output to an open file
fgetc() Returns a single character from an open file
fgetcsv() Returns a line from an open CSV file
fgets() Returns a line from an open file
fgetss() Deprecated from PHP 7.3. Returns a line from an open file - stripped from HTML and PHP tags
file() Reads a file into an array
file_exists() Checks whether or not a file or directory exists
file_get_contents() Reads a file into a string
file_put_contents() Writes data to a file
fileatime() Returns the last access time of a file
filectime() Returns the last change time of a file
filegroup() Returns the group ID of a file
fileinode() Returns the inode number of a file
filemtime() Returns the last modification time of a file
fileowner() Returns the user ID (owner) of a file
fileperms() Returns the file's permissions
filesize() Returns the file size
filetype() Returns the file type
flock() Locks or releases a file
fnmatch() Matches a filename or string against a specified pattern
fopen() Opens a file or URL
fpassthru() Reads from the current position in a file - until EOF, and writes the result to the output buffer
fputcsv() Formats a line as CSV and writes it to an open file
fputs() Alias of fwrite()
fread() Reads from an open file (binary-safe)
fscanf() Parses input from an open file according to a specified format
fseek() Seeks in an open file
fstat() Returns information about an open file
ftell() Returns the current position in an open file
ftruncate() Truncates an open file to a specified length
fwrite() Writes to an open file (binary-safe)
glob() Returns an array of filenames / directories matching a specified pattern
is_dir() Checks whether a file is a directory
is_executable() Checks whether a file is executable
is_file() Checks whether a file is a regular file
is_link() Checks whether a file is a link
is_readable() Checks whether a file is readable
is_uploaded_file() Checks whether a file was uploaded via HTTP POST
is_writable() Checks whether a file is writable
is_writeable() Alias of is_writable()
lchgrp() Changes the group ownership of a symbolic link
lchown() Changes the user ownership of a symbolic link
link() Creates a hard link
linkinfo() Returns information about a hard link
lstat() Returns information about a file or symbolic link
mkdir() Creates a directory
move_uploaded_file() Moves an uploaded file to a new location
parse_ini_file() Parses a configuration file
parse_ini_string() Parses a configuration string
pathinfo() Returns information about a file path
pclose() Closes a pipe opened by popen()
popen() Opens a pipe
readfile() Reads a file and writes it to the output buffer
readlink() Returns the target of a symbolic link
realpath() Returns the absolute pathname
realpath_cache_get() Returns realpath cache entries
realpath_cache_size() Returns realpath cache size
rename() Renames a file or directory
rewind() Rewinds a file pointer
rmdir() Removes an empty directory
set_file_buffer() Alias of stream_set_write_buffer(). Sets the buffer size for write operations on the given file
stat() Returns information about a file
symlink() Creates a symbolic link
tempnam() Creates a unique temporary file
tmpfile() Creates a unique temporary file
touch() Sets access and modification time of a file
umask() Changes file permissions for files
unlink() Deletes a file