O'Reilly logo

PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition by Larry Ullman

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

Sending Data to the Web Browser

To build dynamic Web sites with PHP, you must know how to send data to the Web browser. PHP has a number of built-in functions for this purpose, the most common being echo() and print().

echo 'Hello, world!';

print "It's nice to see you.";

As you can see from this example, either single or double quotation marks will work with either function (the distinction between the two types of quotation marks will be made clear by the chapter’s end). Also note that in PHP all statements (a line of executed code, in layman’s terms) must end with a semicolon.

Looking for an Escape

As you might discover, one of the complications with sending data to the Web involves printing single and double quotation marks. Either of the ...

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