11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 3 • <strong>PHP</strong> BASICSwww.it-ebooks.infoNumber greater than 10: 35Number less than 10: 8The continue StatementThe continue statement causes execution of the current loop iteration to end and commence at thebeginning of the next iteration. For example, execution of the following while body will recommence if$usernames[$x] is found to have the value missing:This results in the following output:Staff member: GraceStaff member: DorisStaff member: GaryStaff member: NateStaff member: TomFile-Inclusion StatementsEfficient programmers are always thinking in terms of ensuring reusability and modularity. The mostprevalent means for ensuring such is by isolating functional components into separate files and thenreassembling those files as needed. <strong>PHP</strong> offers four statements for including such files into applications,each of which is introduced in this section.The include() StatementThe include() statement will evaluate and include a file into the location where it is called. Including afile produces the same result as copying the data from the file specified into the location in which thestatement appears. Its prototype follows:include(/path/to/filename)Like the print and echo statements, you have the option of omitting the parentheses when usinginclude(). For example, if you want to include a series of predefined functions and configurationvariables, you could place them into a separate file (called init.inc.php, for example), and then includethat file within the top of each <strong>PHP</strong> script, like this:86

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!