How to Remove HTML tags from String in PHP - strip_tags() Function
February 05, 2024

The strip_tags() function removes or strips HTML and PHP tags from a given string. It removes all HTML and PHP tags, leaving only the plain text content.

Read More
How to Replace String in PHP - str_replace() Function
January 29, 2024

The str_replace() function replaces all occurrences of a substring (or an array of substrings) with another substring in a given string.

Read More
How to Find Position of Substring in PHP - strpos() Function
January 23, 2024

The strpos() function finds the numeric position of the first occurrence of a substring (needle) in a string (haystack). The string positions start at 0, and not 1.

Read More
How to Convert Special Characters to HTML Entities - htmlspecialchars() Function
January 18, 2024

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings.

Read More
How to Increment or Decrement String in PHP - str_increment() and str_decrement() Functions
January 14, 2024

The str_increment() function Increments an alphanumeric string and str_decrement() decrements an alphanumeric string.

Read More
How to Change Case in PHP - strtolower() and strtoupper() Functions
January 10, 2024

The strtolower() function converts a string to lowercase and the strtoupper() converts a string to uppercase.

Read More
How to Count Words in PHP - str_word_count() Function
January 07, 2024

The str_word_count() function returns the number of words inside string.

Read More
How to Remove Whitespace Characters in a string in PHP - trim() Function
January 06, 2024

Many times, the strings have extra spaces that need to be removed. For example, you might want to replace multiple spaces with a single space or you might want to get rid of all the whitespace in a string. Similarly, you might be planning on stripping all the whitespace from either the left or the right end of a string.

Read More
How to Split String in PHP using Delimiter - explode() Function
January 05, 2024

The explode() function in PHP is used to split a string into multiple strings based on the specified delimiter. This function returns an array of strings.

Read More
How to Find Part of String - substr() Function
January 04, 2024

The substr() function returns a part of a string specified by the offset and length parameters.

Read More
How to Find String Length in PHP - strlen() Function
January 03, 2024

The strlen() function returns the length of a given string. It returns 0 if the string is empty.

Read More
How to Find First Occurrence in String - strstr() and stristr() Function
January 02, 2024

The strstr() and stristr() functions find the first occurrence of a substring (second parameter) inside another string (first parameter), and return all characters from the first occurrence till the end of the string.

Read More