If youâ€™re like most novice PHP developers, you probably have only a passing acquaintance with PHPâ€™s string functions. Sure, you know how to print output to a Web page, and you can probably split strings apart and glue them back together again. But thereâ€™s a lot more to PHPâ€™s string toolkit than this: PHP has more than 175 string manipulation functions, and new ones are added on a regular basis.Ever wondered what they were all for?
If you have, youâ€™re going to be thrilled with the listings in this chapter. In addition to offering you a broad overview of PHPâ€™s string manipulation capabilities, this chapter discusses many other tasks commonly associated with strings in PHPâ€” removing unnecessary whitespace, finding and replacing string patterns, counting and extracting string segments, identifying duplicate words, encrypting text and generating string passwords.
Along the way, youâ€™ll find out a little more about those mysterious string functions, and also learn a few tricks to help you write more efficient code.