How-to articles, tricks, and solutions about PHP

how to change php version in htaccess in server

To change the PHP version for your website using an .htaccess file, you can use the AddHandler directive.

How to check if $_GET is empty?

You can check if the $_GET array is empty by using the empty() function.

How to check if a date is in a given range?

In PHP, you can use the DateTime class to check if a date is within a given range.

How to Check if a Number is Odd or Even in PHP

This is a short snippet that explains how to check whether a number is odd or even in PHP. Check out the handy methods and examples of our tutorial.

How to check if a PHP session is empty?

To check if a PHP session is empty, you can use the empty() function.

How to Check if a Record Exists in a MySQL Database

In this tutorial, we are going to represent to you two handy options of how to check if a record exists in the database with PHP.

How to check if a row exist in the database using PDO?

You can use the rowCount() method of the PDOStatement object to check if a row exists in the database using PDO.

How to check if a string starts with "_" in PHP?

In PHP, you can use the substr() function to check if a string starts with a specific character or substring.

How to check if not instance of some class in symfony2

In Symfony2, you can check if an object is not an instance of a certain class using the "instanceof" keyword in combination with the "!" (not) operator.

How to check if PHP array is associative or sequential?

To check if an array is associative or sequential in PHP, you can use the array_keys() function and compare the resulting array of keys with the original array.

How to check if variable is array?... or something array-like

In PHP, you can use the "is_array" function to check if a variable is an array.

How to check the presence of php and apache on ubuntu server through ssh

To check if PHP is installed on your Ubuntu system, you can use the following command:

How to check where Apache is looking for a php.ini file?

You can check where Apache is looking for the php.ini file by running the command php --ini in the command line.

How to Check Whether a Number is Prime in PHP

Imagine a given number and you want to check whether it is prime or not with PHP. Here, we represent two methods: a simple method and a more efficient one.

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 check whether the user uploaded a file in PHP?

In PHP, you can use the $_FILES superglobal array to check if a file has been uploaded.

How to Configure XAMPP to Send Email from Localhost with PHP

Here is a short tutorial that will assist you in configuring XAMPP to send email from localhost using PHP.

How to Convert a Date Format in PHP

On this page, we are going to help you figure out the main ways of converting date formats in PHP.

How to Convert a PHP Array to a JavaScript Array

In this tutorial, you can find a comprehensive guideline on how to convert a PHP array to JavaScript accurately. Just check out the options and examples.

How to Convert a PHP Object to an Associative Array

If you want to get a proper explanation of how to convert a PHP object to an associative array, you are in the right place. Just follow the examples.

How to Convert a String to a Number in PHP

This snippet is dedicated to one of the common PHP issues: how to convert a string to a number. You can easily do that by following the options we provide.

How to convert a string to JSON object in PHP

You can use the json_decode function in PHP to convert a JSON string into a PHP object.

How to convert an image to Base64 encoding

To convert an image to base64 encoding in PHP, you can use the base64_encode() function

How to Convert an Integer into a String with PHP

In this short guide, we will assist you to deal with one of the common issues in PHP: converting an integer into a string. Read it and follow the examples.

How to Convert DateTime to String in PHP

If you wish to manipulate with the DateTime object in PHP, then this snippet is for you. Here, you will learn how to correctly convert DateTime to string.