Working with strings
Working with strings in real life is really easy. Actions like Check if this string contains this or Tell me how many times this character appears are very easy to perform. But when programming, strings are concatenations of characters that you cannot see at once when searching for something. Instead, you have to look one by one and keep track of what the content is. In this scenario, those really easy actions are not that easy any more.
Luckily for you, PHP brings a whole set of predefined functions that help you in interacting with strings. You can find the entire list of functions at http://php.net/manual/en/ref.strings.php, but we will only cover the ones that are used the most. Let's look at some examples:
<?php $text = ' How can a clam cram in a clean cream can? '; echo strlen($text); // 45 $text = trim($text); echo $text; // How can a clam cram in a clean cream can? echo strtoupper($text); // HOW CAN A CLAM CRAM IN A CLEAN CREAM CAN? echo strtolower($text...