O'Reilly logo

PHP and MySQL Web Development, Third Edition by Laura Thomson, Luke Welling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. String Manipulation and Regular Expressions

In this chapter, we discuss how you can use PHP's string functions to format and manipulate text. We also discuss using string functions or regular expression functions to search (and replace) words, phrases, or other patterns within a string.

These functions are useful in many contexts. You often may want to clean up or reformat user input that is going to be stored in a database. Search functions are great when building search engine applications (among other things).

Key topics covered in this chapter include

  • Formatting strings

  • Joining and splitting strings

  • Comparing strings

  • Matching and replacing substrings with string functions

  • Using regular expressions

Creating a Sample Application: Smart Form ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required