Skip To Content

Athabasca University

Section 5.1 Introduction to PHP

Learning Objectives

After you have completed this section, you should be able to

  • get a general idea of the PHP language.
  • download and install PHP with your Web server on your machine.
  • configure PHP to work with your server.

Activities

Study Questions

  1. What is PHP?
  2. Where can you download PHP for your system?
  3. How do you configure PHP and your web server so that they can work together?
  4. How does PHP work with a web server?
  5. Where should you put your server-side PHP scripts?
  6. How do you embed PHP scripts in an HTML file?
  7. How do you embed PHP scripts in your web documents?
  8. How do you convert between data types in PHP?
  9. What data types does PHP provide?
  10. What basic functions can you use?
  11. What operators can be used to make expressions?
  12. How is the scope of a variable decided in PHP?
  13. How do you access HTML form variables with PHP?
  14. How do you declare variables in PHP?
  15. How do you assign values to variables in PHP?
  16. What control structures does PHP provide?
  17. What are legal identifiers in PHP?
  18. How do you use array in PHP?
  19. What tags can you use to embed PHP scripts in an HTML file?
  20. What are legal PHP statements?
  21. How do you make comments in your PHP scripts?
  22. What are strings in PHP?
  23. How do you concatenate one string to another?
  24. What other operations can you apply to strings? How?
  25. How is the type of a variable determined in PHP?
  26. How do you cast one type to another?
  27. What are variable variables? What can they be used for?
  28. What is the execution operator in PHP?
  29. What are variables in PHP?
  30. How do you assign values to variables in PHP?
  31. How do you initialize and manipulate arrays in PHP?
  32. How do you test and set variable type in PHP?
  33. How do you test variable status?
  34. What statuses can a variable have?
  35. How do you access files in PHP?
  36. What are numerically indexed arrays in PHP? How do you use them?
  37. What are associative arrays? How do you use them?
  38. What are multdimensional arrays?
  39. How do you reorder arrays?
  40. How do you define functions in PHP?
  41. How do you call a defined function in PHP?
  42. How is the object-oriented paradigm implemented in PHP? That is, how do you define and use classes in PHP?
  43. What arithmetic operators can you use in PHP?
  44. How do you compare strings in PHP?
  45. How do you write selection statements in PHP?
  46. How do you write repetition statements in PHP?
  47. How do you define and use functions in PHP?

Summary

Many language constructs used by PHP are similar to those in other programming languages. You should have no problem understanding the fundamental elements of PHP language if you are able to use other programming languages. Particular attention should be paid to the constructs that are not used in other languages, such as associative arrays, as well as testing and setting types/status of variables.

From this section you should have learned what PHP is, what it does, where to get a copy for your platform, and how to install and configure PHP to work with your web server, as well as how to write the simplest PHP scripts.

Updated May 06 2022 by FST Course Production Staff