List/Grid Monthly Archives: August 2010
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…
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…
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…
Calculating the length of a string using PHP
The PHP function strlen can be used to find out how many characters are in a string. This is very useful for validating that there’s data in a string, and…
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…






