SlideShare a Scribd company logo
Beginning PHP
      Session #1
  September 29, 2011
       Josh Butts
Who Am I?
Josh Butts
   Director of Development at Vertive
        Offers.com, CouponCodes.com, DailyDeals.com,
        Subscription.com, and about 25 others...
   Organizer of Austin PHP
   Zend Certified Engineer (PHP5 and Zend Framework)
   Follow me online: “jimbojsb” pretty much everywhere
What are we going to learn?
   LAMP Stack
   Variables
   Control Structures
   Functions
   MySQL
   Forms
   Basic Security
One small adjustment:


No class on 10/20/11, as I’ll be speaking at Zendcon
Class Resources

Google group for slides, questions, etc:
http://groups.google.com/group/geekaustin-php
Sample code & homework:
https://github.com/jimbojsb/bgphp-2011
PHP Versions


I’m using 5.3.6, but 5.2.0 or above will work for this class
No one should be using PHP 4.x at this point
Where to get PHP?

   I recommend a package, especially for
   development
      XAMPP is popular, and generally works
      Zend Server CE is my preferred “one click”
      installer
Seriously, get a good editor
   Basic (Syntax highlighting)
          Windows: Notepad++, UltraEdit*, jEdit, KomodoEdit
          Mac: TextMate*, BBEdit*, jEdit, KomodoEdit
          Linux: gEdit, KomodoEdit
   IDE (I’d recommend this)
          All the good ones are cross platform
          Komodo IDE*
          Eclipse PDT
          Netbeans
          Zend Studio* (Eclipse PDT + Premium Features)
          PHPStorm* (My personal favorite, this is amazing software)

                                                                       *Not Free
The LAMP Stack
Linux, Apache, MySQL, PHP
LAMP powers a good bit of the internet
Sites you know and love
     Yahoo!
     Facebook
     Wikipedia
     Wordpress.com
     Whitehouse.gov
     Flickr
General Concept
PHP + Apache

               Apache
  Browser
                   PHP
PHP + CGI

  Browser     Apache


        PHP
Hello World
   3 easy ways to do
   this
   Many other,
   irrelevant ones
   Last way exploits
   “pass through”
   mode
PHP Files

.php extension
Can contain PHP, HTML, CSS, JavaScript, whatever (but this
isn’t a good practice)
Can be split into many smaller files
Should be kept secure
PHP Tags

Tells PHP when to start and stop processing code
Open Tag
   <? and <?PHP
Close Tag
   ?> - this is optional
Variables
Store data - pretty much anything you can think of
    Text, numbers, arrays, objects, XML, MySQL data, etc ,etc ,etc
Always start with a $
Can contain
    upper and lower case letters
    underscores ( _ )
    cannot lead with a number ($3 is not valid)
PHP is loosely typed...mostly
Code Comments

Not executed
// - comment one line
/* */ - comment multiple lines
# - also a comment, but deprecated
Operators
Booleans
   true or false, 1 or 0
   ==, ===, >, <, ||, !
Arrays

Arrays are still variables
Associative and regular
Can be multi-dimensional (only limited by memory)
Many, many array functions
php.net/arrays
Working With Regular Arrays
Working With Associative Arrays
More on Arrays
   Arrays, specifically associative arrays, are one of the most used
   features in PHP
   Arrays can store anything, including other arrays (because
   variables can store anything)
PHP Functions

Built-in functions contain the bulk of PHP’s functionality
Syntax: function_name($argument1, $argument2, ...)
Always available
One More Thing...

There’s homework
It’s totally optional
Designed to help you explore & extend what we cover in
class
PHP.net is your friend

More Related Content

Viewers also liked (12)

KEY
GeekAustin PHP Class - Session 6
jimbojsb
 
KEY
Fall 2011 PHP Class - Session 2
jimbojsb
 
PDF
Geek Austin PHP Class - Session 1
jimbojsb
 
PPT
Geek Austin PHP Class - Session 2
jimbojsb
 
KEY
Austin NoSQL 2011-07-06
jimbojsb
 
KEY
GeekAustin PHP Class - Session 7
jimbojsb
 
PPT
Geek Austin PHP Class - Session 3
jimbojsb
 
PPT
Geek Austin PHP Class - Session 4
jimbojsb
 
PDF
Security in php
Jalpesh Vasa
 
KEY
Scaling php applications with redis
jimbojsb
 
PPT
Php ssession - cookies -introduction
Programmer Blog
 
PPTX
Session php
200Hussain
 
GeekAustin PHP Class - Session 6
jimbojsb
 
Fall 2011 PHP Class - Session 2
jimbojsb
 
Geek Austin PHP Class - Session 1
jimbojsb
 
Geek Austin PHP Class - Session 2
jimbojsb
 
Austin NoSQL 2011-07-06
jimbojsb
 
GeekAustin PHP Class - Session 7
jimbojsb
 
Geek Austin PHP Class - Session 3
jimbojsb
 
Geek Austin PHP Class - Session 4
jimbojsb
 
Security in php
Jalpesh Vasa
 
Scaling php applications with redis
jimbojsb
 
Php ssession - cookies -introduction
Programmer Blog
 
Session php
200Hussain
 

Similar to Fall 2011 PHP Class - Session 1 (20)

PPT
Introduction to PHP - SDPHP
Eric Johnson
 
PPT
Php classes in mumbai
Vibrant Technologies & Computers
 
PPTX
PHP from soup to nuts Course Deck
rICh morrow
 
PDF
Introduction to PHP (SDPHP)
Eric Johnson
 
PPT
MIND sweeping introduction to PHP
BUDNET
 
PPT
Php
zalatarunk
 
PPT
phpwebdev.ppt
rawaccess
 
PPT
Phpwebdev
Luv'k Verma
 
PPT
rtwerewr
esolinhighered
 
PPT
Php introduction with history of php
pooja bhandari
 
PPT
php fundamental
zalatarunk
 
PPT
php
Ramki Kv
 
PPTX
PHP ITCS 323
Sleepy Head
 
PPTX
PHP Hypertext Preprocessor
adeel990
 
PPT
05php
sahilshamrma08
 
PPT
05php
Shahid Usman
 
PPT
Synapse india reviews on php website development
saritasingh19866
 
Introduction to PHP - SDPHP
Eric Johnson
 
Php classes in mumbai
Vibrant Technologies & Computers
 
PHP from soup to nuts Course Deck
rICh morrow
 
Introduction to PHP (SDPHP)
Eric Johnson
 
MIND sweeping introduction to PHP
BUDNET
 
phpwebdev.ppt
rawaccess
 
Phpwebdev
Luv'k Verma
 
rtwerewr
esolinhighered
 
Php introduction with history of php
pooja bhandari
 
php fundamental
zalatarunk
 
PHP ITCS 323
Sleepy Head
 
PHP Hypertext Preprocessor
adeel990
 
Synapse india reviews on php website development
saritasingh19866
 
Ad

Recently uploaded (20)

PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
July Patch Tuesday
Ivanti
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Ad

Fall 2011 PHP Class - Session 1

  • 1. Beginning PHP Session #1 September 29, 2011 Josh Butts
  • 2. Who Am I? Josh Butts Director of Development at Vertive Offers.com, CouponCodes.com, DailyDeals.com, Subscription.com, and about 25 others... Organizer of Austin PHP Zend Certified Engineer (PHP5 and Zend Framework) Follow me online: “jimbojsb” pretty much everywhere
  • 3. What are we going to learn? LAMP Stack Variables Control Structures Functions MySQL Forms Basic Security
  • 4. One small adjustment: No class on 10/20/11, as I’ll be speaking at Zendcon
  • 5. Class Resources Google group for slides, questions, etc: http://groups.google.com/group/geekaustin-php Sample code & homework: https://github.com/jimbojsb/bgphp-2011
  • 6. PHP Versions I’m using 5.3.6, but 5.2.0 or above will work for this class No one should be using PHP 4.x at this point
  • 7. Where to get PHP? I recommend a package, especially for development XAMPP is popular, and generally works Zend Server CE is my preferred “one click” installer
  • 8. Seriously, get a good editor Basic (Syntax highlighting) Windows: Notepad++, UltraEdit*, jEdit, KomodoEdit Mac: TextMate*, BBEdit*, jEdit, KomodoEdit Linux: gEdit, KomodoEdit IDE (I’d recommend this) All the good ones are cross platform Komodo IDE* Eclipse PDT Netbeans Zend Studio* (Eclipse PDT + Premium Features) PHPStorm* (My personal favorite, this is amazing software) *Not Free
  • 9. The LAMP Stack Linux, Apache, MySQL, PHP LAMP powers a good bit of the internet Sites you know and love Yahoo! Facebook Wikipedia Wordpress.com Whitehouse.gov Flickr
  • 11. PHP + Apache Apache Browser PHP
  • 12. PHP + CGI Browser Apache PHP
  • 13. Hello World 3 easy ways to do this Many other, irrelevant ones Last way exploits “pass through” mode
  • 14. PHP Files .php extension Can contain PHP, HTML, CSS, JavaScript, whatever (but this isn’t a good practice) Can be split into many smaller files Should be kept secure
  • 15. PHP Tags Tells PHP when to start and stop processing code Open Tag <? and <?PHP Close Tag ?> - this is optional
  • 16. Variables Store data - pretty much anything you can think of Text, numbers, arrays, objects, XML, MySQL data, etc ,etc ,etc Always start with a $ Can contain upper and lower case letters underscores ( _ ) cannot lead with a number ($3 is not valid) PHP is loosely typed...mostly
  • 17. Code Comments Not executed // - comment one line /* */ - comment multiple lines # - also a comment, but deprecated
  • 19. Booleans true or false, 1 or 0 ==, ===, >, <, ||, !
  • 20. Arrays Arrays are still variables Associative and regular Can be multi-dimensional (only limited by memory) Many, many array functions php.net/arrays
  • 23. More on Arrays Arrays, specifically associative arrays, are one of the most used features in PHP Arrays can store anything, including other arrays (because variables can store anything)
  • 24. PHP Functions Built-in functions contain the bulk of PHP’s functionality Syntax: function_name($argument1, $argument2, ...) Always available
  • 25. One More Thing... There’s homework It’s totally optional Designed to help you explore & extend what we cover in class PHP.net is your friend

Editor's Notes