Skip to content

Tag Archives: PHP-string

We have given a string and the task is to count number of characters in a string str in PHP. In order to do this… Read More
The is_string() function is an inbuilt function in PHP which is used to check whether the given value is a string or not. Syntax: bool… Read More
The ctype_lower() function is an inbuilt function in PHP which is used to check whether the given characters in the string is lower case or… Read More
The setlocale() function is an inbuilt function in PHP which is used to set locale information. Locale setting means assigning your system a geographical location… Read More
Regular expressions commonly known as a regex (regexes) are a sequence of characters describing a special search pattern in the form of text string. They… Read More
Single or double quotes in PHP programming are used to define a string. But, there are lots of differences between these two. Single-quoted Strings: It… Read More
To get a substring between two strings there are few popular ways to do so. Below the procedures are explained with the example.Examples:   Input:$string="hey, How… Read More
Strings are the collection of characters. For example, ‘G’ is the character and ‘GeeksforGeeks’ is the string. Installation: These functions are not required any installation.… Read More
Use variable name as a string to get the variable name. There are many ways to solve this problem some of them are discussed below:… Read More
There is a lot of options to remove all specific characters at the end of a string. Some of them are discussed below: Using rtrim()… Read More
Given a string and the task is to convert given string to its boolean. Use filter_var() function to convert string to boolean value. Examples: Input… Read More
Generate a random, unique, alpha-numeric string using PHP. Examples: EA070 aBX32gTf APPROACH 1: Brute Force The first approach is the simplest one to understand and… Read More
There are many ways to generate a random, unique, alphanumeric string in PHP which are given below:  Using str_shuffle() Function: The str_shuffle() function is an… Read More
Given a multiple line sentence or statement the task is to convert the whole statement in a single line. See the example below. Examples: Input… Read More
Converting the string to Date and DateTime uses several functions/methods like strtotime(), getDate(). We will see what these functions do. strtotime() – This is basically… Read More

Start Your Coding Journey Now!