There are many times when we need to do more complex processing with strings. PHP provides us with the instructions we need to verify and manipulate strings. In this hands-on lab, you will continue learning about processing strings in PHP. But let’s go a step further and build a string processing utility plugin.
You will need to process strings when building websites. Checking for things like:
- does a string start or end with a character or substring
- does a substring exist
These are common string handling functions. In addition, you’ll need to truncate to a certain number of words or characters, join an array of strings, split strings, and more.
Instead of hunting around for the functionality that you need, let’s build a plugin with that functionality. Then you can use it on every project…over and over again.
Prerequisites
Hands off the keyboard. Web development starts by thinking first, then planning it out, and then coding it.
Episodes
Total Lab Runtime: 01:58:54
- 1 Lab Introductionfree 03:24
- 2 Checking if String Starts With a Character or Substringpro 13:43
- 3 Explaining the "String Starts With" Strategypro 13:35
- 4 Check if String Ends With a Character or Substring - Part 1pro 15:11
- 5 Check if String Ends With a Character or Substring - Part 2pro 12:52
- 6 Has Substringpro 04:27
- 7 Truncate by Characterspro 17:18
- 8 Truncate by Wordspro 14:35
- 9 Converting to Lowercasepro 07:58
- 10 Converting to Uppercasepro 01:30
- 11 Splitting a String into An Arraypro 07:17
- 12 Joining Array Elements into a Stringpro 03:43
- 13 Wrap it Uppro 03:21