Categories
PHP

Localizing Dates

How to localize dates manually or with strftime() function.

Categories
PHP

Localizing Dates with IntlDateFormatter Class

How to use the IntlDateFormatter class to handle tasks as internationalized dates, calendar generation, time and date formatting, etc.

Categories
PHP

Sunset, Sunrise, Transit and Twilight

How to get information about sunset/sunrise, transit and twilight begin/end for a specified date, longitude and latitude.

Categories
PHP

Using Relative Paths for File Access

Usually, files are opened (or searched) relative to the path of the document. To be sure that you are searching for the current script’s path, you can use a two-step approach: The constant __FILE__ contains the full path of the current script, and the function dirname() determines the directory name portion of a path.

Categories
PHP

ZipArchive – Zip and Unzip Files and Folders

Let’s create a compressed Zip archive in PHP with ZipArchive class, which provides many features for reading and writing Zip archives.

Categories
PHP

Zipping and Unzipping a File with Zlib and Bzip2

How to compress files in PHP with compress.zlib:// and compress.bzip2:// streams (and with gzopen() and bzopen()).

Categories
PHP

Recursive Directory Iterator

How to use DirectoryIterator and RecursiveDirectoryIterator classes to loop through all files and folders inside a directory.

Categories
PHP

Reading Directories Contents

How to browse the file system with the help of PHP functions.

Categories
PHP

Copying, Moving and Deleting Files

Learn how to rename, move, copy or delete files in PHP.

Categories
PHP

Reading Information About Files

Learn how to get all file information, for example, get modification time with filemtime(), get last access time with fileatime(), get group id with filegroup(), get user id with fileowner(), get size with filesize() and use the stat() function to get all information (meta data) about a file.