words all fail the magic prize

 

« | main | »

a mishmash of basic php

  • literal is the term (noun) used to describe raw data, such as text
  • variables and literals can be combined in output in two ways: variable names can be placed alongside literals within double-quoted strings, or single quoted literals can be concatenated with variables. The concatenation symbol is the period.
  • this distinction occurs because php attempts to evaluate the contents of double-quoted strings, whereas single-quoted strings are not evaluated
  • found a nice discussion of the difference between GET and POST methods here: http://www.cs.tut.fi/~jkorpela/forms/methods.html
  • identifier is a generic term for the names given to variables, functions, classes
  • php identifiers are case sensitive, and cannot begin with a digit (I haven’t quite figured out the use of $ yet)
  • php does not require variables to be declared before they are used
  • constants can be declared using the define() function
  • variables can have one of four types of scope
    1. built-in superglobal variables are visible everywhere within a script
    2. global variables declared in a script are visible throughout the script, but not inside functions
    3. variables used inside functions are local to the function
    4. variables used inside functions that are declared as global refer to the global variables of the same name

I think this last should read “variables that are declared as global inside functions refer to the global variables of the same name”.

Welling, Luke and Laura Thomson. PHP and MySQL Web Development. 2nd ed. Indianapolis: Sam’s, 2003.

Posted by pzed on January 23, 2008 at 12.40pm
Categories: libraries, music, web stuff

Post a comment