Tuesday, December 23, 2008

Beginning PHP Study


I have ordered PHP for the World Wide Web by Larry Ullman, for step by step learning and Wicked Cool PHP for scripts to try.

While awaiting the arrival of these two books I have become impatient! I am starting to study an online set of tutorials at
Zend Developer Zone . The first section is named "Down the Rabbit Hole" written by by Vikram Vaswani and gives a very basic explanation (with examples) of both the building blocks of PHP and why it is such a great language. Here is a list of what I have picked up today by reading Part 1:

  • there is an opening and closing php tag
  • every php statement ends with a semicolon ;
  • variables are the big deal in php
  • variables are containers/buckets/constructs to hold numeric or alphabetic data
  • $ means variable and is directly followed by a letter or an underscore
  • there are variables of these types: Booleans, integers, floating point numbers(look like decimals to me), strings(letters following letters words?) and arrays
  • you can add single line comments// or multiline /* */
  • the equal sign (just as it says): $whatever=a value which can be a whole lot of different things such as another variable, an expression or even expression with variables!!!
  • Boolean variables are the simplest: true or false
Over on the PHP site, you can read all you want to know about variable types! More from there!

Expressions are the most important element (building blocks) of PHPand the most basic of expressions are constants and variables. Another WOW about expressions!
  • expressions are parsed from right to left
So, if you were to have this expression: $y=8; then $x=($y=8) means 8 is assigned as the value of $x so it would be $x=$y=8

During PHP 101 at LVS, I got past the idea of the assigned value of a variable being so -well- variable, and having the ability to be redefined at the drop of a statement.

Things for me are quite basic:
  • = is the operator used to assign value to variables
  • echo is a function which "prints" the expression to an output device which, in this case, is the browser

I come away from Part 1 with a better understanding of things I sort of knew, but not confidently. Confidence, with PHP I need more of that! Somewhere in the reading, I also got the impression that I can be the 'Boss' here! Make PHP do what I need it to do.

Tomorrow, or next time, I will briefly go over other operators.

$Variables =building blocks
$Operators= mortar
Enough for today.

No comments: