Fireship · @fireship

PHP in 100 Seconds

Uploaded October 22, 2021 · Length 2:21

PHP in 100 Seconds

Summary

PHP basics: dynamic language for web development, server-side scripting, and building interactive websites.

  • php basics
  • web development
  • server-side scripting
  • php tutorial

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    [Music]

  2. 0:00

    PHP a dynamic interpreted scripting

  3. 0:03

    language for building interactive

  4. 0:04

    websites on the server despite the

  5. 0:06

    haters pronouncing it dead it remains

  6. 0:08

    one of the most popular languages for

  7. 0:10

    back-end web development it Powers

  8. 0:11

    content Management Systems like

  9. 0:12

    WordPress top tier websites like

  10. 0:14

    Wikipedia and countless others via

  11. 0:16

    Frameworks like LVL and Symphony hell

  12. 0:19

    man even Facebook uses it although they

  13. 0:20

    built a custom compiler to convert it to

  14. 0:22

    machine code on their servers it was

  15. 0:24

    created in 1994 by Rasmus lerdorf to

  16. 0:27

    manage his personal homepage clever

  17. 0:29

    acronym but it sounds lame for a

  18. 0:31

    language that powers multi-billion

  19. 0:32

    dollar Enterprises so today we practice

  20. 0:34

    cognitive dissonance to tell ourselves

  21. 0:36

    PHP stands for hypertex pre-processor it

  22. 0:39

    has a special place in history because

  23. 0:41

    it predates JavaScript and was one of

  24. 0:42

    the first languages to be embedded

  25. 0:44

    directly in HTML allowing websites to be

  26. 0:46

    built dynamically on a server it's open

  27. 0:49

    source and was one of the technologies

  28. 0:50

    that revolutionized the web by making

  29. 0:52

    application development accessible to

  30. 0:54

    the average person its interpreter is

  31. 0:56

    implemented in C and has a syntax

  32. 0:58

    inspired by Pearl to get started create

  33. 1:00

    a PHP file and add some basic HTML to it

  34. 1:04

    within this file you can go into PHP

  35. 1:06

    mode by opening a question mark PHP tag

  36. 1:09

    the code Within These tags will be

  37. 1:10

    rendered on the server use Echo to

  38. 1:12

    Output a value in the location of the

  39. 1:14

    tag to declare a variable give it a name

  40. 1:17

    that starts with a dollar sign followed

  41. 1:18

    by a value it's a weekly type language

  42. 1:21

    so no type annotations are necessary it

  43. 1:23

    also comes with a large number of

  44. 1:24

    predefined variables geared towards web

  45. 1:26

    development like git post and cookie

  46. 1:29

    which contain information about the

  47. 1:30

    incoming HTTP request now when this code

  48. 1:33

    is rendered on your server it will

  49. 1:34

    output an HTML string with the PHP tags

  50. 1:37

    being replaced by whatever you echoed

  51. 1:39

    the language also supports multiple

  52. 1:41

    programming paradigms you have first

  53. 1:42

    class functions which can be assigned to

  54. 1:44

    variables or used anonymously as

  55. 1:46

    argument and it has tons and tons of

  56. 1:48

    built-in functions to do pretty much

  57. 1:50

    anything a web developer could ever

  58. 1:51

    imagine doing it also has a complete

  59. 1:54

    object model where you can Define

  60. 1:55

    classes with inheritance to implement

  61. 1:57

    objectoriented patterns we're currently

  62. 1:59

    on PHP version 8 which has all the