How to Get Multiple Values of Selected Checkboxes in PHP

Sometimes we need to submit the checkbox with multiple values in form and Get Multiple selected checkboxes value. In this tutorial we are going to discuss how we can get multiple values of selected checkboxes in PHP. We know that checkbox is used for multiple selection in form. Many time we can see when we have to take the multiple selection from the user for example there is a form...
Array to XML Conversion and XML to Array Convert in PHP

Array to XML Conversion and XML to Array Convert in PHP

Many times we need to store the data in XML format into the database or into the file. In this article, we are going to discuss how we can convert array to XML and XML to array in PHP. Nowadays we mainly use JSON format to store and send the data from one location to another. But what if we require to store or send the data in XML format....
How to get the first character of a string in PHP

How to get the first character of a string in PHP

Many times in the application we required to add or remove some part of the string for use. So in this tutorial, we will learn how to get the first characters of a string in PHP. For example, we have to take the first 5 characters from the string to show in the website, or we need to show string first character in the web application. In this scenario, we...
How to Remove Last Character from String in PHP

How to Remove Last Character from String in PHP

This tutorial is all about how to remove last character from the string in PHP. We will understand it with the help of 4 inbuilt PHP functions. Sometimes we need to eliminate or remove the some part of the string like special characters or something in the beginning and ending of the string. For example we need to perform some loop or activity in our web application in a condition...
Use of mb_substr with example

Use of mb_substr with example

Performs a multi-byte safe substr() operation based on the number of characters. The position is counted from the beginning of str. The first character's position is 0. The second character position is 1, and so on. Syntax: mb_substr($str,$start,$end,$encoding) What is mb_substr() function mb in mb_substr() function stands for multi-byte, when we manipulate the string with the help of inbuilt functions like trim(), split(), splice(), etc strings encoded in a multi-byte, and when we...
How to Get Number of Days Between Two Dates in PHP

How to Get Number of Days Between Two Dates in PHP

Sometimes we need to calculate the days between two given dates. In this post, we will see How to Get Number of Days Between Two Dates in PHP with an example. So there are two ways to do the same, one is using the PHP date_diff() and another is using strtotime() function. We encountered many times in a project when we struggle to manipulate the result around dates. When we...
How to Partially hide or mask email addresses in PHP

How to Partially hide or mask email addresses in PHP

In this post, we are going to discuss how we can hide or mask email addresses using PHP. We can see in many application some part of the email is hidden for security. Even if you visit your profile on some big website they keep it to masked and show it to you when you click on the show email id option just like a password. As you have observed...
How to Remove Special Character From String in PHP

How to Remove Special Character From String in PHP

Sometimes we need to delete or replace all the unwanted characters from the string. In this post, we will learn how to Remove Special Character From String in PHP. We will use very simple and easy preg_replace() and str_replace() functions in PHP. In a project when we work we need to sanitize the data sometimes as per requirement. Let's suppose we have to get the data using API and in...