Fall 2011 PHP Class - Session 1

767 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
767
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Fall 2011 PHP Class - Session 1

    1. 1. Beginning PHP Session #1 September 29, 2011 Josh Butts
    2. 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. 3. What are we going to learn? LAMP Stack Variables Control Structures Functions MySQL Forms Basic Security
    4. 4. One small adjustment:No class on 10/20/11, as I’ll be speaking at Zendcon
    5. 5. Class ResourcesGoogle group for slides, questions, etc:http://groups.google.com/group/geekaustin-phpSample code & homework:https://github.com/jimbojsb/bgphp-2011
    6. 6. PHP VersionsI’m using 5.3.6, but 5.2.0 or above will work for this classNo one should be using PHP 4.x at this point
    7. 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. 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. 9. The LAMP StackLinux, Apache, MySQL, PHPLAMP powers a good bit of the internetSites you know and love Yahoo! Facebook Wikipedia Wordpress.com Whitehouse.gov Flickr
    10. 10. General Concept
    11. 11. PHP + Apache Apache Browser PHP
    12. 12. PHP + CGI Browser Apache PHP
    13. 13. Hello World 3 easy ways to do this Many other, irrelevant ones Last way exploits “pass through” mode
    14. 14. PHP Files.php extensionCan contain PHP, HTML, CSS, JavaScript, whatever (but thisisn’t a good practice)Can be split into many smaller filesShould be kept secure
    15. 15. PHP TagsTells PHP when to start and stop processing codeOpen Tag <? and <?PHPClose Tag ?> - this is optional
    16. 16. VariablesStore data - pretty much anything you can think of Text, numbers, arrays, objects, XML, MySQL data, etc ,etc ,etcAlways 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. 17. Code CommentsNot executed// - comment one line/* */ - comment multiple lines# - also a comment, but deprecated
    18. 18. Operators
    19. 19. Booleans true or false, 1 or 0 ==, ===, >, <, ||, !
    20. 20. ArraysArrays are still variablesAssociative and regularCan be multi-dimensional (only limited by memory)Many, many array functionsphp.net/arrays
    21. 21. Working With Regular Arrays
    22. 22. Working With Associative Arrays
    23. 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. 24. PHP FunctionsBuilt-in functions contain the bulk of PHP’s functionalitySyntax: function_name($argument1, $argument2, ...)Always available
    25. 25. One More Thing...There’s homeworkIt’s totally optionalDesigned to help you explore & extend what we cover inclassPHP.net is your friend

    ×