PHP in 60 Seconds: The Basics

แชร์
ฝัง

ความคิดเห็น • 144

  • @noname9305
    @noname9305 8 หลายเดือนก่อน +190

    so much information in 60 seconds 👏👏👏

  • @DevGio
    @DevGio 7 หลายเดือนก่อน +159

    For all you new people out there reading comments, PHP is super valuable to learn right now. There are a plethora of jobs needing PHP developers to maintain old systems. Much easier to get a job in php, than to try and get a job in a newer language/framework.

    • @kidzeezy0112
      @kidzeezy0112 7 หลายเดือนก่อน +2

      can you direct me in this direction sir? how do I even start learning this from scratch?

    • @fuzzy-02
      @fuzzy-02 6 หลายเดือนก่อน +31

      ​@@kidzeezy0112you should know how to use google. This is the most basic fundamental skill.
      I am not looking down or mocking you.
      Train your brain to think of solution first, go to google second.
      Say to yourself "others will google the answer to tell me. I am not blind. I can search myself too"

    • @samuraijosh1595
      @samuraijosh1595 6 หลายเดือนก่อน +4

      ​@@fuzzy-02 lol we gotta tell 'em haha.

    • @ForexPeak
      @ForexPeak 5 หลายเดือนก่อน +5

      ​@kidzeezy0112 I would recommend using traversy media's front to back series for php then when you're done with that and have a good understanding of what it's all about and build a few projects with php I'd advice you go on and learn the laravel framework👍

    • @natescode
      @natescode 4 หลายเดือนก่อน +3

      Only if you live in India.

  • @dschledermann
    @dschledermann 4 หลายเดือนก่อน +20

    I've been a PHP programmer for 22 year. (Yes, since 2001, version 4-something). The language has changed a lot in that time. At the beginning it was very similar to Perl and C, now it's more like Java. Lately however, in my company, some projects are being rebooted in C# and new stuff tends not to be done with PHP at all. I feel like PHP is declining in popularity, which makes me a little sad because I really like the language and I have no interest in C# and all the Microsoft associations that come with it.

  • @jock3rbr
    @jock3rbr 2 หลายเดือนก่อน +4

    PHP is a multi purpose language. And here we see just one scenario. Good tips.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 ปีที่แล้ว +75

    0:28 You can put a trailing comma after the last item in the list. That can ease program maintenance in some situations.

    • @likithaapraveen8726
      @likithaapraveen8726 11 หลายเดือนก่อน +4

      What’s a trailing comma?

    • @aimranovlogs4153
      @aimranovlogs4153 9 หลายเดือนก่อน

      comma at end of value@@likithaapraveen8726

    • @paw565
      @paw565 9 หลายเดือนก่อน

      ​@@likithaapraveen8726comma at the end I guess

    • @paskuini
      @paskuini 9 หลายเดือนก่อน

      ​@@likithaapraveen8726he means a comma after the "0" value associated to the "third" index in the associative array

    • @reviewofall5478
      @reviewofall5478 9 หลายเดือนก่อน

      ​@@likithaapraveen8726$var => value,

  • @jeremiahsmarketing
    @jeremiahsmarketing ปีที่แล้ว +35

    If you kmow a bit of SQL, its not that's hard to grasp at each glance

  • @fuzzy-02
    @fuzzy-02 6 หลายเดือนก่อน +11

    Beware: you cannot access variables you declared in your file from inside a function UNLESS you re-declare them in the function with a global prefix.
    Example:
    ```php
    $var = "foo";
    function boo(){
    echo $var;
    }
    ```
    Will not echo the string foo because of scope. It will be null basically as the function cannot see the one declared outside.
    Unless you add a global $var in the function like this:
    ```php
    $var = "foo";
    function boo(){
    global $var;
    echo $var;
    }
    ```
    Will echo "foo" as intended.
    You can also pass by value like bo($var) but that is obvious

    • @IllIIIIIIllll
      @IllIIIIIIllll 6 หลายเดือนก่อน +2

      So "global" word should write in front of it?

    • @Vichion
      @Vichion หลายเดือนก่อน +2

      The reasoning behind this behavior is rooted in the way PHP handles variable scope. By default, variables within a function are considered local to that function. To access a global variable inside a function, you need to use the global keyword to explicitly indicate that the function should use the variable from the global scope. This design helps prevent unintended side effects and makes the code more modular and easier to understand by clearly delineating where variables are defined and used.

    • @bilalillahi6347
      @bilalillahi6347 29 วันที่ผ่านมา

      Informative

  • @dzvsow2643
    @dzvsow2643 3 หลายเดือนก่อน +5

    I wish I could afford to buy your udemy course. you are amazing teacher

    • @hasanaldaas4109
      @hasanaldaas4109 2 หลายเดือนก่อน +1

      Normally it you check it out a few times they give you a huge discount

    • @Joneewars2
      @Joneewars2 2 หลายเดือนก่อน

      Udemy courses are cheap and sometimes they give huge discounts.

  • @antonioianniello7337
    @antonioianniello7337 3 หลายเดือนก่อน +5

    Actually the video is very useful for those who just know programming language quite well and want to learn php.

    • @Microphunktv-jb3kj
      @Microphunktv-jb3kj หลายเดือนก่อน

      .. i would never use php outside of context of Laravel lol...
      there's very little reasons to use php tbh...
      php/laravel is good for todo apps...
      ever seen anything more built with it? : )))
      php servers keels over faster than a node server...
      backend in node/php is error on itself...
      just use Go or Elixir for backend or something else...

    • @antonioianniello7337
      @antonioianniello7337 29 วันที่ผ่านมา +1

      @@Microphunktv-jb3kj The problem is that you cant use Laravel without knowing php.
      Or better, you can...but you will write something you dont understand deeply.

  • @hello_world_zz
    @hello_world_zz 10 หลายเดือนก่อน +11

    Question, folks. I've been writing desktop applications in C# for 10 years. I want to move towards web development. There is scalability and microservices... really eager for it. Employers see that I have no practical knowledge in this area and turn me down. But I can potentially get a position in PHP. Should I go for PHP? Thank you very much, your answer is highly important 🙏

    • @dave-hollingworth
      @dave-hollingworth  10 หลายเดือนก่อน +6

      I would yes - it's still very popular - explained well here: medium.com/@london.lingo.01/10-reasons-why-php-is-still-relevant-in-2023-d533ed6dc687

    • @hello_world_zz
      @hello_world_zz 10 หลายเดือนก่อน +5

      @@dave-hollingworth thanks a lot, Dave 🙏. You know, in the middle of 40 to change carriers is very exiting

    • @rdmon746
      @rdmon746 3 หลายเดือนก่อน +1

      If you are already proficient in C#, there isn't much use in stepping backwards to php

  • @prasanth.v4170
    @prasanth.v4170 ปีที่แล้ว +14

    What is the output

  • @Mind_exersice
    @Mind_exersice หลายเดือนก่อน

    Love it. Php learning is in my future learning plan❤

  • @Hyperslob
    @Hyperslob 9 หลายเดือนก่อน +6

    I’m just happy to be here😂

  • @EyBossPusi
    @EyBossPusi 7 หลายเดือนก่อน +4

    If our professor explain it simply back then we would get it lol.

  • @adityag6022
    @adityag6022 4 หลายเดือนก่อน +2

    Thank you sir

  • @greatvedas
    @greatvedas 4 หลายเดือนก่อน +3

    Hypothetically you could teach rocket-science under 2 hours

  • @stickking44
    @stickking44 10 หลายเดือนก่อน +12

    People have been telling me for years that php is trash. Now I have to learn after seeing this

    • @ericg3065
      @ericg3065 5 หลายเดือนก่อน +4

      I was told the same thing 15 years ago. I fell for the hype of other so called hot languages

    • @lucaszecat
      @lucaszecat หลายเดือนก่อน

      ​@@ericg3065 what your final conclusion ?

  • @greatvedas
    @greatvedas 4 หลายเดือนก่อน +1

    brilliant

  • @fmachine86
    @fmachine86 5 หลายเดือนก่อน +3

    Whole lot of people in here who aren’t devs acting like they’re devs.

  • @kingsgambit9284
    @kingsgambit9284 5 วันที่ผ่านมา

    Php will be comfortable for people to learn who came from linus os n had learnt bash scripting

  • @whatthefunction9140
    @whatthefunction9140 10 หลายเดือนก่อน +16

    $data["first"]
    Shoukd be $data['first']
    So php doesnt check for a variable

    • @Sparky-FTW
      @Sparky-FTW 5 หลายเดือนก่อน +2

      Thnks bro

  • @dmitriylaptiev9409
    @dmitriylaptiev9409 หลายเดือนก่อน

    I am gonna add PHP to my CV after that video

  • @BassirouNiang-u4u
    @BassirouNiang-u4u 9 วันที่ผ่านมา

    Brillant🎉

    • @BassirouNiang-u4u
      @BassirouNiang-u4u 9 วันที่ผ่านมา

      Est-ce que je peux avoir tes contact svp

  • @Rptr797-wn4iu
    @Rptr797-wn4iu หลายเดือนก่อน +1

    C and html based python

  • @Mark_Justine
    @Mark_Justine 9 หลายเดือนก่อน +2

    What is the font style you are using in your vscode i like it

    • @dave-hollingworth
      @dave-hollingworth  9 หลายเดือนก่อน

      Droid Sans Mono (according to the settings - I've never changed it, it was set by the theme I believe)

  • @mulunehtsega6333
    @mulunehtsega6333 หลายเดือนก่อน

    NICE

  • @rodrigoqteixeira
    @rodrigoqteixeira หลายเดือนก่อน

    Wait, is that a real html tag?
    Like I can do it rn and it will work?

  • @120artyom
    @120artyom 2 หลายเดือนก่อน +1

    Thanks for video! After watching that I’ve finally got a job in IT

  • @user-ss8gw8tw3s
    @user-ss8gw8tw3s ปีที่แล้ว +1

    Output su Aave che

  • @notpowder5831
    @notpowder5831 16 วันที่ผ่านมา

    your college lesson for one month in one minute

  • @Steve-Richter
    @Steve-Richter ปีที่แล้ว +29

    My vote is for JavaScript syntax, arrays, objects to be enabled in PHP.

    • @ademineshat
      @ademineshat ปีที่แล้ว +16

      PHP is a Backend language and JavaScript runs in the browser. What do you mean to be enabled?

    • @coderswat
      @coderswat ปีที่แล้ว +4

      ​@@Steve-Richter 😂😂

    • @coderswat
      @coderswat ปีที่แล้ว +4

      ​@@Steve-Richter php is a backend language you can't do like that, you need a class

    • @IISveirII
      @IISveirII 10 หลายเดือนก่อน +11

      >Javascript syntax
      *vomits*

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 10 หลายเดือนก่อน +5

      @@IISveirII Still nicer than PHP.

  • @StumpsAndSixes-ik9wg
    @StumpsAndSixes-ik9wg 10 หลายเดือนก่อน +2

    Wowww in 60s😂

  • @daniellaplanagimeno3927
    @daniellaplanagimeno3927 8 หลายเดือนก่อน

    Wich vscode theme are you using?

    • @dave-hollingworth
      @dave-hollingworth  8 หลายเดือนก่อน

      This one: www.vscolors.com/themes/bf8aa94a-4051-42fe-9bd1-2becad466fe7-41e84e99

  • @kingsgambit9284
    @kingsgambit9284 5 วันที่ผ่านมา

    Its so ez i thought php is hard its features n syntax like that writing shell script in bash but with few changes

  • @berkaybakacak
    @berkaybakacak 3 หลายเดือนก่อน +1

    I hate this language but this video is useful

  • @stellarhexus9655
    @stellarhexus9655 9 หลายเดือนก่อน +1

    What's a good programming example for starters?

    • @dave-hollingworth
      @dave-hollingworth  9 หลายเดือนก่อน +1

      Try this one: th-cam.com/video/Y9yE98etanU/w-d-xo.html

    • @Kammreiter
      @Kammreiter 26 วันที่ผ่านมา

      This is: HTML to MySQL with PHP 😎

  • @Munii45
    @Munii45 7 หลายเดือนก่อน

    Name this app

  • @youtube_tag
    @youtube_tag 10 หลายเดือนก่อน

    What is the theme u are using??

    • @dave-hollingworth
      @dave-hollingworth  10 หลายเดือนก่อน +1

      This one: www.vscolors.com/themes/bf8aa94a-4051-42fe-9bd1-2becad466fe7-41e84e99

    • @youtube_tag
      @youtube_tag 10 หลายเดือนก่อน +1

      @@dave-hollingworth thanks

  • @romania-n6q
    @romania-n6q 9 หลายเดือนก่อน +2

    and everyone complaining that JS is weird

  • @chaloappsgamechannelandminecra
    @chaloappsgamechannelandminecra 3 หลายเดือนก่อน

    guys do you notice? PHP programming doesn't show error

    • @lucaszecat
      @lucaszecat หลายเดือนก่อน +1

      It does in the browser (dev env)

  • @james_zapanta
    @james_zapanta ปีที่แล้ว +7

    is php still good? i mean with all the new languages/tech out there, can you still get a decent job using it?
    php beginner here.

    • @dave-hollingworth
      @dave-hollingworth  ปีที่แล้ว +11

      Absolutely, it's still one of the most used languages out there for web development. Mostly because it's so widely supported - it's available on almost all web hosting. Plus it's very simple to pick up and start using, and WordPress (which runs a huge proportion of the web's sites) uses it. So definitely still worth learning and you can get a decent job with it.

    • @ivanjelenic5627
      @ivanjelenic5627 11 หลายเดือนก่อน +10

      Yes, in the last decade and especially the last few years it has improved dramatically. Many features were added to make it easier, nicer, and cleaner to write code, and the performance increased over 4 times. Couple that with composer for managing packages, git, and Laravel framework for making websites, it's a pleasure to code in. There's many big companies using PHP, including Facebook. Also about 80% of all websites on the internet are still using PHP.
      You can get a decent job, yes, given that a vast majority of sites are using PHP. Even if you decide to switch later, you will learn lots of concepts from PHP and Laravel that are applicable in other languages and frameworks. On average, it's not the most paid job, but that's probably because of all those sites.

    • @StumpsAndSixes-ik9wg
      @StumpsAndSixes-ik9wg 10 หลายเดือนก่อน +2

      ​@@dave-hollingworthsome tech nerds dont know the value of PHP doesnt even know and start speaking shit 😂

    • @pau1phi11ips
      @pau1phi11ips 9 หลายเดือนก่อน +4

      There's a reason PHP still powers +75% of the web and all the JS frameworks combined are barely 3%.

  • @ArrowheadMapping6767
    @ArrowheadMapping6767 ปีที่แล้ว

    What is the software he is using called

  • @chiko7650
    @chiko7650 8 หลายเดือนก่อน

    Foreach is “while” in Python?

    • @dave-hollingworth
      @dave-hollingworth  8 หลายเดือนก่อน

      stackoverflow.com/questions/44404475/what-is-the-equivalent-of-foreach-php-in-python#:~:text=The%20equivalent%20of%20the%20foreach,e.g.&text=It%20actually%20works%20for%20all%20iterables%20in%20python%2C%20including%20strings.&text=However%2C%20it%20is%20worth%20noting,they%20are%20a%20shallow%20copy.

    • @miyu545
      @miyu545 8 หลายเดือนก่อน +3

      No, foreach is an iteration while, while is a condition.

  • @jonakthakuria8508
    @jonakthakuria8508 3 หลายเดือนก่อน

    just consolidated first 5 tuts in 60s

  • @reynanlamsen2007
    @reynanlamsen2007 หลายเดือนก่อน

    This is very similar to C, isn't it?

  • @qwertyasdfg7782
    @qwertyasdfg7782 9 หลายเดือนก่อน +1

    this is php template engine 😂

  • @SamsungA04e-dp7kj
    @SamsungA04e-dp7kj หลายเดือนก่อน

    JOKO WIDODO

  • @ahmedemad1020
    @ahmedemad1020 8 หลายเดือนก่อน +1

    Lol 😂 are u fr ? You must change title to 1990s
    you have completely ignored the entire new system of php that the new frameworks like laravel are count on
    PHP OOP

    • @dave-hollingworth
      @dave-hollingworth  8 หลายเดือนก่อน +5

      Thank you for the feedback! The idea of this video was to cover the syntax basics that are necessary no matter whether you're using a framework or not. I did what I could in 60 seconds (the maximum time for a TH-cam short). I'll cover OO and Laravel in further shorts though.

  • @ivanjelenic5627
    @ivanjelenic5627 11 หลายเดือนก่อน +4

    Please dont show the == operator to newbies, hell, dont show it to anyone. Just use ===

    • @cedrictheveneau9141
      @cedrictheveneau9141 10 หลายเดือนก่อน

      Since I’ve seen people saying we should use === I’ve always had the reflex to use 3 of them instead of two, I don’t really know what difference it makes though, but if it helps have a more solid code, that’s still worth it anyway

    • @kubiku
      @kubiku 10 หลายเดือนก่อน

      ​@@cedrictheveneau9141if u use == (1 == "1" will be true) but if u use (1 === "1" will be false) === will also check the data type to be equal.

    • @sliver37
      @sliver37 9 หลายเดือนก่อน +2

      @@cedrictheveneau9141
      Anyone who might be wondering:
      “2” == 2 will be true. (Sorta equals)
      “2” === 2 will be false. (Exactly equals)
      The == will perform type coercion if it has to. Which is why “2” (a string) and 2 (an integer) will become true. It’s easier to run into bugs if you don’t fully understand it. That’s why === is almost always the best option.

  • @brkenheartd
    @brkenheartd 9 หลายเดือนก่อน

    vs code currently does not even read my php :( why

    • @dave-hollingworth
      @dave-hollingworth  9 หลายเดือนก่อน

      Bit difficult to say without more details - check your files are named with ".php" at the end, and that they're in a folder you have permission to read from

    • @brkenheartd
      @brkenheartd 9 หลายเดือนก่อน

      @@dave-hollingworth all is correct on that part..what i'm trying to do is write php within html and it doesn't read it ?

    • @dave-hollingworth
      @dave-hollingworth  9 หลายเดือนก่อน +2

      @@brkenheartd Make sure you're using the correct tags, e.g.

    • @brkenheartd
      @brkenheartd 9 หลายเดือนก่อน

      @@dave-hollingworth yes but it's a self-hosted server with a free domain and local host tunneling...I switched from running plain NGINX to running off Laragon which included php in the environment so that I couldn't install or get php to work in the local host myself or in NGINX even tho it has it.

    • @brkenheartd
      @brkenheartd 9 หลายเดือนก่อน

      @@dave-hollingworth it doesn't matter as long as the php works i'm glad ^_^

  • @YoutubeP-vn1de
    @YoutubeP-vn1de 3 หลายเดือนก่อน

    Can you help me in 1 script fixing I will pay bro

  • @Abendplaner
    @Abendplaner 11 หลายเดือนก่อน +2

    This is old php4 style

    • @pau1phi11ips
      @pau1phi11ips 9 หลายเดือนก่อน

      It is only 60 seconds... 🤨

  • @etoddyneles.7429
    @etoddyneles.7429 4 หลายเดือนก่อน

    Coloque legendas em português😢

    • @samuca101
      @samuca101 2 หลายเดือนก่อน +1

      Se tu quer ser programador a primeira coisa que deveria aprender é inglês.

  • @GoldEnrolled1
    @GoldEnrolled1 4 หลายเดือนก่อน

    Lost me at $

  • @hamdanaldabbas1574
    @hamdanaldabbas1574 3 หลายเดือนก่อน

    Wtf is this ? Why are there so many dollar signs?

  • @trb147
    @trb147 10 หลายเดือนก่อน +2

    U gotta chill bruh talking too fast cuh

    • @MohammadSafa-ms5nw
      @MohammadSafa-ms5nw 6 หลายเดือนก่อน +3

      "PHP in 60 seconds" bro , he's supposed to speak fast otherwise he won't finish in time!

    • @trb147
      @trb147 6 หลายเดือนก่อน

      ​@MohammadSafa-ms5nw Nah make it php in 120 sec then

    • @MohammadSafa-ms5nw
      @MohammadSafa-ms5nw 6 หลายเดือนก่อน +1

      @@trb147 then it won't be a TH-cam short.

  • @shashankkulkarni993
    @shashankkulkarni993 9 หลายเดือนก่อน

    I am not interested in PHP

  • @WaldemarDellgg
    @WaldemarDellgg ปีที่แล้ว +3

    First sentence ist wrong

    • @Vichion
      @Vichion ปีที่แล้ว +1

      Its truthy, but yes, php only require the opening tag in a pure php file.

    • @mihoteo
      @mihoteo 11 หลายเดือนก่อน

      Also you can put types for variables so another mistake

    • @dave-hollingworth
      @dave-hollingworth  11 หลายเดือนก่อน +1

      Well, you can type hint function arguments and properties, which will create an error if you pass a varable that contains a value that doesn't match the type hint. However you can't specify that a variable contains a specific type unfortunately.

    • @mihoteo
      @mihoteo 11 หลายเดือนก่อน

      @@dave-hollingworth /* @var int $a */
      $a = 1
      Is enough for phpstorm

  • @Dylan_thebrand_slayer_Mulveiny
    @Dylan_thebrand_slayer_Mulveiny 2 หลายเดือนก่อน +1

    "To concatenate a string we use a dot. " No. Don't. Please don't. Use sprintf. Use printf. Hell, use a fucking array and join. Just please don't use dots.