Enter your Sign-on user name and password.

Forgot password?
  • Follow us on:
Loading video...
Text Comments (3)

2 answers

Last reply by: Matthew Machaj
Tue Feb 7, 2012 2:17 AM

Post by Jacob Case on November 19, 2011

This is proving to be a very thorough and exhaustive course. I haven't found other online PHP courses with comparable scope and depth. The way you alternate the practical application of building a web store with lessons about the fundamentals is perfect for me. THANK YOU!

Constants

  • A constant is an identifier that can be assigned a data value that cannot change during the execution of a script.
  • Constants can only be assigned scalar (integer, float, string, & boolean) values.
  • Constant identifiers obey the same naming rules as variable identifiers, except that they do not begin with a dollar sign.
  • Constant identifiers cannot be used within double-quoted strings as variable interpolation does not apply to constants.
  • PHP provides two ways of declaring constants:
    • Using the define() function
    • An assignment statement using the const keyword
  • When using the define() method, a constant can be assigned the value of any expression, not just a static value.
  • $_SERVER is a superglobal variable that is automatically defined and made available by PHP. It contains information about the webserver configuration and the current script.
  • $_SERVER[‘DOCUMENT_ROOT’] provides the full path in the local file system to the currently running webserver’s document root.
  • Additional Resources:

Constants

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

Computer Science: Introduction to PHP