Implementing Upper and Lowercase Functions
Explore how to implement uppercase, lowercase, and swap case functions for ASCII characters in PHP using Laravel. Understand the role of ASCII values, and the PHP ord and chr functions while handling UTF-8 strings.
We'll cover the following...
We'll cover the following...
Implementation of case functions
As stated earlier, one of the benefits of UTF-8 is that it preserves the ASCII values and their relative positions. We can explore working more closely with strings by reimplementing the upper- and lowercase functions. We will only focus on the ASCII character range to keep things simple.
It is important to note that UTF-8 includes only the first 128 ASCII ...