Prev | Current Page 134 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"


Even if you??™re a novice programmer, it??™s strongly suggested you become familiar with
advanced documentation solutions and get into the habit of using them for even basic applications.
Multiple-Line C Syntax
It??™s often convenient to include somewhat more verbose functional descriptions or
other explanatory notes within code, which logically warrants numerous lines. Although
you could preface each line with C++ or shell-style delimiters, PHP also offers a
multiple-line variant that can open and close the comment on different lines. Here??™s
an example:
CHAPTER 3 ?–  PHP BASICS 61
/*
Title: My PHP Program
Author: Jason
Date: July 26, 2007
*/
?>
Outputting Data to the Browser
Of course, even the simplest of Web sites will output data to the browser, and PHP
offers several methods for doing so.
?– Note Throughout this chapter, and indeed the rest of this book, when introducing functions I??™ll refer
to their prototype. A prototype is simply the function??™s definition, formalizing its name, input parameters,
and the type of value it returns, defined by a datatype. If you don??™t know what a datatype is, see the
section ???PHP??™s Supported Datatypes??? later in this chapter.
The print() Statement
The print() statement outputs data passed to it to the browser. Its prototype looks
like this:
int print(argument)
All of the following are plausible print() statements:
print("

I love the summertime.


Pages:
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146