Categories
PHP

How to break long paragraphs

The text on a screen is harder to read than in a book but short paragraphs keep the content readable. In this tutorial, I’ll explain how to convert or split a long paragraph into short paragraphs with the help of PHP’s built-in functions

Categories
PHP

Sorting with Foreign Languages

How to sort multibyte string properly with PHP’s sort() function.

Categories
PHP

Emailing Form Data

Sending emails via PHP mail() function.

Categories
PHP

Saving Form Data into a File

Learn how to serialize (and unserialize) the form data in PHP for storing it in a file.

Categories
PHP

Validating Selection Lists

How to create a dropdown list from an array, validate selection lists using the in_array() function and validate multiple lists with array_diff() function.

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.