Chapter 5. Using Strings
As introduced in Chapter 2, “Variables,” the second category of variables used by PHP is strings—a collection of characters enclosed within either single or double quotation marks. A string variable may consist of a single letter, a word, a sentence, a paragraph, HTML code, or even a jumble of nonsensical letters, numbers, and symbols (which might represent a password). Strings may be the most common variable type used in PHP.
Passwords, names, email addresses, comments, and similar input from HTML forms all become strings in your PHP script. You witnessed this behavior when you used the feedback.html
and handle_form.php
pages in Chapter 3, “HTML Forms and PHP.”
This chapter covers PHP’s most basic built-in functions for ...
Get PHP for the World Wide Web, Second Edition: Visual Quickstart Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.