Skip to content

Tag Archives: PHP-string

The str_contains() is a predefined function that is introduced with the release of PHP 8. The str_contains() function search for the substring in the given… Read More
The task is to convert DateTime to String using PHP. There are two ways to convert it.   1. By using Format method  In the… Read More
A string is a storage object in PHP comprising characters, numbers or special symbols. Strings in PHP are case-sensitive. The interconversion between lower and upper… Read More
To convert the first character of all the words present in a string to uppercase, we just need to use one PHP function i.e. ucwords().… Read More
A table is an arrangement of data in rows and columns, or possibly in a more complex structure. Tables are widely used in communication, research,… Read More
Multi-Line Strings can be written in PHP using the following ways. Using escape sequences: We can use the \n escape sequences to declare multiple lines… Read More
In this article, we will find the last character of a string in PHP. The last character can be found using the following methods. Using… Read More
The purpose of this article is to extract numbers from a string using PHP. Approach: We can use the preg_replace() function for the extraction of… Read More
The best way to convert uppercase string to lowercase in PHP is by using the strtolower() function. It takes the string as the input and… Read More
In this article, we are going to replace the String with another by using the PHP built-in str_replace() function. A String is a collection of… Read More
A string is a collection of given characters and a substring is a string present in a given string. In this article, we are going… Read More
We have given two strings and the task is to append a string str1 with another string str2 in PHP. There is no specific function… Read More
We have given a string and the task is to remove white space only from beginning of a string or end from a string str… Read More
We have given a string and the task is to remove special characters from a string str in PHP. In order to do this task,… Read More
We have given an array containing some array elements and the task is to join all the array elements to make a string. In order… Read More