Category: PHP Functions

Using String Position and Substring to Extract a Portion of a String using PHP 0

Using String Position and Substring to Extract a Portion of a String using PHP

We’re going to use several string functions together. Let’s take the string testing testing Username:Michele Davis and retrieve only the name. Using several functions together to extract a portion of a string This Code...

Checking for a String using PHP 0

Checking for a String using PHP

To detect whether a string is part of another string, use strstr. This function takes two parameters: the string to search through and the string to search for. It is not case sensitive; if...

Changing Case (Uppercase to lowercase or inverse) using php 0

Changing Case (Uppercase to lowercase or inverse) using php

PHP provides functionality for changing the case of a string to all uppercase, all lowercase, or the first letter of a word to uppercase. The commands are strtoupper, strtolower, and ucwords, respectively. Using the...

Cutting up strings or Extract a portion of a string using PHP 0

Cutting up strings or Extract a portion of a string using PHP

The substring functions provide a way to extract a portion of a string. All that’s needed is the string to work with, the position to start from, and how many characters to extract. Use...