Introduction to PHP - SDPHP

530 views
496 views

Published on

Introduction to PHP.

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
530
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to PHP - SDPHP

  1. 1. INTRODUCTION TO PHP SDPHPTwitter: @sdphp | www.sdphp.org (coming soon) MeetUp: www.meetup.com/SanDiegoPHP/
  2. 2. Who we are:Presenters John Congdon - Senior Web Developer at Networx Online Twitter: @johncongdon Email: john@sdphp.org LinkedIn: http://www.linkedin.com/in/johncongdon Eric Van Johnson - Systems Architect at AMCO International Education Services,Inc. Twitter: @shocm Email: eric@sdphp.org LinkedIn: http://www.linkedin.com/in/vanjohnsonSan Diego PHP User Group San Diego PHP Meetups => http://www.meetup.com/SanDiegoPHP/Facebook => https://www.facebook.com/groups/SanDiegoPUG/IRC => freenode.net #sdphp
  3. 3. A quick historyCreated in 1994 by Rasmus Lerdorf and was a set of simple Common Gateway Interface (CGI) binaries written in the C programming language that he used for tracking visits to his online resume, he named the suite of scripts "Personal Home Page Tools"In 1998 PHP 3.0 is announced and is a complete rewrite of the platform. By thistime Andi Gutmans and Zeev Suraski of Tel Aviv, Israel join Rasmus tocollaborate on the new implementation. This is also when PHP got its officialname PHP: Hypertext Preprocessor, which is a recursive acronym.
  4. 4. A quick history (cont.)PHP 4 is released in 2000 sporting a new engine dubbed Zend Engine (comprised of the first names of Zeev and Andi). PHP 4.0 introduces a wide range of additional new features. In addition to the highly improved performance it also included key features such as support for many more web servers, HTTP sessions, output buffering, more secure ways of handling user input and several new language constructs.There are companies that still use PHP 4.x in their production environment. (And we like to make fun of them)PHP 5 released in 2004 powered by Zend Engine II with a new object mode.Current stable version of PHP is 5.4.8. Several new features come packed in thecurrent releases of PHP such as Namespace support, Native JSON support, andsecurity improvements.
  5. 5. Who uses PHP?EVERYONE!Google / Yahoo / Facebook / Sony / Bank of America / NYSE / AT&T /
  6. 6. OPEN & CLOSING TAGS
  7. 7. VARIABLESA Variable, as the name suggests, can have its value change during the execution of a script.
  8. 8. CONSTANTSA constant, once defined, cannot be changed or unset. Traditionally constants are uppercase.
  9. 9. INCLUDE FILE.. ONCE
  10. 10. INCLUDING MISSING SCRIPTS
  11. 11. TYPES IN PHP • Strings • Integers • Floats • Arrays • and many more...
  12. 12. STRINGS Whats the difference?
  13. 13. INTEGERS
  14. 14. ARRAYS Arrays are zero-based. Arrays can be of mixed types
  15. 15. ASSOCIATIVE ARRAYS Key => Value pairs of data
  16. 16. FLOW CONTROL
  17. 17. FOR LOOPS
  18. 18. FOREACH LOOPS
  19. 19. FOREACH LOOPS
  20. 20. WHILE LOOPS
  21. 21. DO WHILE
  22. 22. SWITCH CASES
  23. 23. CONTINUE AND BREAK • for • foreach • while • do ... while • switch
  24. 24. ALTERNATE SYNTAXES
  25. 25. ALTERNATE SYNTAX: IF
  26. 26. ALTERNATE SYNTAX: FOR
  27. 27. ALTERNATE SYNTAX: FOREACHALTERNATE SYNTAX: WHILE
  28. 28. FUNCTIONS
  29. 29. CLASSES
  30. 30. MAGIC: GET
  31. 31. MAGIC: GET
  32. 32. MAGIC: SET
  33. 33. STATIC
  34. 34. CLASS CONSTANTS
  35. 35. CLASS VISIBILITY
  36. 36. METHOD OVERLOADING
  37. 37. DATABASE ACCESSWhy you should be using PDO (PHP Data Objects)•Cross Database Driver support•Prepared Statements•Proper bindings•and lots lots more
  38. 38. MODELS, VIEWS, CONTROLLERS• Code Separation• Reusability• Ease Refactoring
  39. 39. MODELS • a model represents your data • Logical container for o Database calls o API Access • Models usually represent o Tables in a database o a file or collection of files on a hard drive o Documents stored in Mongo o Any other data containers you need to define
  40. 40. VIEWS
  41. 41. VIEW.. MODELS?
  42. 42. CONTROLLERS
  43. 43. Other cool things PHP can do thatnot a lot of people know.• PHP CLI - PHP files dont have to be web pages. PHP is a very powerful language that can be used from the command line to perform a wide range of system task.• As of PHP 5.4.0, the CLI SAPI provides a built-in web server. $ cd ~/public_html$ php -S localhost:8000
  44. 44. More other cool things• As of PHP 5.1.0, the CLI SAPI provides an interactive shell using the -a option.
  45. 45. PHP Tools• Text Editor (Notepad / Notepad ++)• VimIDEs• Eclipse (Open Source) o PDT Plugin (Open Source) o Aptana PHP (Open Source)  Aptana Studio Pro (Commercial) o Zend Studio (Commercial)• NetBeans (Open Source)• PhpStorm (Commercial)• NuSphere PhpED (Commercial)
  46. 46. What do employers look for?• A college degree, so you are on the right track• Code examples. Willyou have check publicly contributed account. Make sure typically some for a Github code. Open Source Projects are good place to do this.• Certifications o Zend PHP Certifications http://www.zend.com/services/certification/ o MySQL Developer http://education.oracle.com/pls/web_prod-plq- dad/db_pages.getpage?page_id=458&get_params=p_track_id:MDEV
  47. 47. What else do employers look for? PASSIONDevelopment is a very personal thing. A developer needs to be creative, logical, focused, and enjoy what they are doing. Get involved with the PHP community. Forums, StackOverflow, Local User Groups like SDPHP ;-)
  48. 48. ResourcesLocal San Diego PHP Meetups => http://www.meetup.com/SanDiegoPHP/Facebook => https://www.facebook.com/groups/SanDiegoPUG/IRC => freenode.net #sdphpTwitter => @sdphp / @shocm / @johncongdon / @williammanleyOthers Zend.com StackOverflow => http://stackoverflow.com/questions/tagged/phpphp|Arch => http://www.phparch.com/
  49. 49. CreditsOriginal Presentation byWilliam Cahill-Manley - Application Developer for Submodal Twitter: @williammanley Email: william@sdphp.orgTodays Presenters John Congdon - Senior Web Developer at Networx Online Twitter: @johncongdon Email: john@sdphp.org LinkedIn: http://www.linkedin.com/in/johncongdon Eric Van Johnson - Systems Architect at AMCO International Education Services, Inc. Twitter: @shocm Email: eric@sdphp.org LinkedIn: http://www.linkedin.com/in/vanjohnson

×