How-to articles, tricks, and solutions about PHP

How to Sort a Multidimensional Array by Value

In this short tutorial, you will learn the most efficient ways to easily sort a multidimensional array by value using PHP. Just follow the steps below.

How to Check Whether an Array Is Empty in PHP

On this page, we represented to you the three principal ways that allow programmers to detect whether a given array is empty or not. Just see the examples.

How to Redirect a Web Page with PHP

In PHP, you can use several functions to make a redirect from one web page to another. Learn how to do it accurately with W3docs.

How to Download a File in PHP

PHP is a popular general-purpose scripting language. It provides files to the user by forcing them to download. Know how to download a file in PHP correctly.

How to Detect Browser with PHP

Browser detection is used to determine the web browser a visitor is using and to serve browser-appropriate content to the visitor. Know how to do it with PHP.

How to Create and Parse JSON Data with PHP

JSON is a data-interchange format, which can be generated and parsed by PHP or other programming languages. See how to create and parse JSON data by PHP.

How to Parse XML with PHP

XML (Extensible Markup Language) is used to store and transport data. Learn how to accurately parse XML with PHP simpleXML library in this simple snippet.

How to Validate URL with PHP

In this snippet, we provide guidelines on one of the most common issues in PHP. Here, we show the most straightforward way on how to validate URL with PHP.

How to Validate an Email with PHP

This tutorial explains how to validate an email using the PHP arsenal. Check out the examples of how to do that with the help of a PHP function and regex.

How to Get Remote IP Address in PHP

Sometimes getting the IP address of the client can be tricky. With the help of this snippet, you will manage to get the real remote IP address in PHP.

Post Requests with cURL

cURL is applied for making requests with different protocols. A post request can send user collected data to a server. Find out how to do that accurately.

How to Send Email via PHP

PHP mail is a built in PHP function that is used for sending emails from PHP scripts. Check out our snippet to learn how to send email via PHP accurately.

How to Remove Files from Folder with PHP

PHP does not have a specific undo for what you delete from anywhere. This snippet will represent how to remove files from folder permanently using PHP.

How to Create URL Slug from String in PHP

Here is a short tutorial that will represent to you the way of creating a URL slug from string with PHP. It should be an essential part of any website.