Abstract
After reading this chapter you should be able to:
-
describe the basic structure of a PHP script or scripting block
-
understand how a PHP file containing a mixture of HTML and PHP is processed
-
discriminate between valid and invalid names for variables and functions
-
explain the similarities and differences between a scalar variable and an array
-
explain the differences between strings enclosed in single and double quotes and the use of escape sequences in strings
-
explain the importance of system functions to programming in PHP
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
In this extreme case there is no benefit in using the file extension php rather than htm or html.
- 2.
Print statements in PHP have no connection with printing on paper. In early programming languages the word 'print' did have that meaning, but in more modern languages it has come to mean outputting to the user's screen. For PHP it simply means send a string of characters to the user's web browser, which will display it on the screen or otherwise depending on the contents.
- 3.
Assignment statements and the other statements described briefly in this section will be discussed in more detail in later sections.
- 4.
The operator == (two 'equals' signs) is used here to test whether the value of variable $x is the constant 1. It is not to be confused with the = operator used in an assignment.
- 5.
The web browser will convert the newline character, followed by two tab characters to a single space on the user's screen.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Bramer, M. (2015). PHP Fundamentals. In: Web Programming with PHP and MySQL. Springer, Cham. https://doi.org/10.1007/978-3-319-22659-0_2
Download citation
DOI: https://doi.org/10.1007/978-3-319-22659-0_2
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-22658-3
Online ISBN: 978-3-319-22659-0
eBook Packages: Computer ScienceComputer Science (R0)