Skip to content

Tag Archives: PHP-string

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
Remove the very first character of a given string in PHP Examples: Input : Geeksforgeeks Output : eeksforgeeks Input :, Hello geek! Output : Hello… Read More
Given a sentence, a string and the position, the task is to insert the given string at the specified position. We will start counting the… Read More
The strncmp() is an inbuilt function in PHP which is used to compare first n character of two strings. This function is case-sensitive which points… Read More
The strip_tags() function is an inbuilt function in PHP which is used to strips a string from HTML, and PHP tags. This function returns a… Read More
The ctype_punct() function in PHP is used to check if all of the characters of a given string are punctuation characters or not. If all… Read More
The ctype_cntrl() function is an inbuilt function in PHP and is used to check if all of the characters of a given string are control… Read More
The convert_cyr_string() function is a inbuilt function in PHP. The function is used to convert a string form one Cyrillic character-set to another. Here two… Read More