We had a great PHP intro from Alex.
- I really liked the way Alex taught the class. He had about 7 slides and with each slide, he showed us some code and then asked us what we thought it would do. Then we pasted the code in a scripting site to see if we were right. He went through the 4 options in the ‘universal machine’ slide (input/output, assignments, conditionals, loops) and showed us how to do each one in PHP. He also encouraged us to use the Lynda.com and codecademy.com PHP tutorials.
- LAMP stack is Linux, Apache, MySQL, PHP. There are also MAMP (Mac) and WAMP (Windows).
- Basic components of Turing’s universal machine (he cautions
that this is grossly simplified):
- input/output mechanism (x goes in, y comes out)
- capacity to do assignments (x=y)
- ability to do simple logic/conditionals (if x then y)
- loops/ability to repeat things over and over again (do x, y times)
- Basic PHP Syntax
- A PHP script can be placed anywhere in the document
- It usually starts with a <php and ends with ?>
php //PHP code goes here ?>
- The default file extension for PHP files is “.php”.
- A PHP file normally HTML tags, and some PHP scripting code.