Posts from PHP

How to remove the last comma from a PHP foreach loop?

By Faruque Ahamed Mollick

Using PHP foreach loop, we can list the items of an array easily. Also, sometimes we may need to give comma signs after each array. But in English grammar, we should not place the .... Read More

Detect the browser in PHP

By Faruque Ahamed Mollick

In this tutorial, we are going to see how to detect the browser of a user using PHP programming language. Here we are going to create our own custom PHP function which we can call .... Read More

Convert Unix timestamp into a formatted understandable time string in PHP

By Faruque Ahamed Mollick

Often Unix time format is used in programming related work. But this type of time or date format is not understandable by the human. So it should be converted into a human readabl.... Read More

Remove duplicate values from an array in PHP

By Faruque Ahamed Mollick

In this post, we are going to see how to remove the duplicate values from an array in PHP. It may be necessary for many times to take only unique values from an array by removing a.... Read More

Calculate the difference between two dates in PHP

By Faruque Ahamed Mollick

In this PHP tutorial, we are going to calculate the date difference between two dates. At first, we will take two dates and by using PHP we will find how many days difference betw.... Read More

Generating random CSS hex color code using PHP md5() function

By Faruque Ahamed Mollick

In this post, we are going to see how to generate random CSS hex color code using the PHP md5() function. The PHP md5() function calculates the MD5 hash of a string. Using this fu.... Read More

Get the width and height of an image in PHP

By Faruque Ahamed Mollick

In this tutorial, we are going to see how to get the width and height of an image in PHP. Getting the width and the height of an image is an easy task using PHP. PHP already has an.... Read More

Check if a variable in PHP does exist or not

By Faruque Ahamed Mollick

In PHP, we often see the “Undefined variable” notice. The notice shows when the variable we call does not exist. In this post, we are going to see how to check if a var.... Read More