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...
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...
How to Count The Number of Pages in a PDF file

How to Count The Number of Pages in a PDF file

In this tutorial, you will learn How to Count The Number of Pages in a PDF file. If you need to count the page in the PDF file before performing some tasks in the web application, then we have given the easy code below. We can count the number available page in the PDF file easily. Following the tutorial guide, you step by step to learn it and get the...
How to Partially Hide Phone in PHP?

How to Partially Hide Phone in PHP?

In this tutorial, we will show you how to hide or mask the mobile number using PHP. Most of the time we require to hide the partial details which we do not want to show the end-user. And among those details, the phone number is one, so it's basically functionally that we need to integrate into the web application as per requirement. Sometimes we need to hide or mask the...
How to use curl in PHP

How to use curl in PHP

In this article, we are going to see how to How to use curl in PHP. There are many ways to fetch and post the data on the webpage. Normally we pass the data on the webpage using form submission, internal functions, and APIs. But sometimes we need to send the data from one server to another server. In that case, PHP provides us cURL built-in PHP extension. cURL is an...