Skip to main content
  • 4009 Accesses

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

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    In this extreme case there is no benefit in using the file extension php rather than htm or html.

  2. 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. 3.

    Assignment statements and the other statements described briefly in this section will be discussed in more detail in later sections.

  4. 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. 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

Authors

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics