Tuesday, November 13, 2012

PHP Notes

I am trying to teach myself PHP and this post is just of my notes for PHP. I know a lot of this information is already out there on the web, but it helps me remember and learn when I write things down.

So, needless to say, this post will continue to grow over time.

Beginning and Ending Blocks

Standard Tag<?php?>
Short Tag<??>
Script Tag<script language="php"></script>


Variables in PHP begin with a dollar ($) sign and either a letter or an _ (underscore).

Variables do not need to be declared as a type, the PHP engine decides the variable type based on type of data the variable holds.
Types of Variable:
IntegerWhole number
DoubleFloating point number (Decimal Point)
StringCollection of characters
BooleanTrue or false

Difference Between =, = =, and = = =
  • = : Sets the value of a variable
  • = = : Comparative operator; Means equivalent (Are variables X and Y apples?)
  • = = = : Comparative operator; Means exactly the same (Are these apples exactly the same? Both have that green and dark red spot?)

No comments:

Post a Comment