How To Work With Arrays In PHP - Full PHP 8 Tutorial

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 128

  • @rafagamezdiaz
    @rafagamezdiaz 3 роки тому +27

    I agree with most of the comments. This course is great, because you go into detail about things and explain very clearly. It's great to have a solid grasp of the language. Thank you for this great contribution that most programmers will surely appreciate a lot!!!

  • @Armando-px8hi
    @Armando-px8hi Рік тому +2

    Happy to see the guys in the comments that are appreciating you,You do really deserve it man.Please keep it going master.I can not wait to get to the project tutorial.

  • @jipeejoce1353
    @jipeejoce1353 4 роки тому +27

    Once again, you don't disappoint.
    Best tut on PHP arrays ever made !
    Hope we're doing some simple/cool PHP project in the near future.

    • @ProgramWithGio
      @ProgramWithGio  4 роки тому +6

      Thank you 😊. Yes we'll do a project soon.

  • @alonglongchar58
    @alonglongchar58 2 роки тому +10

    Probably one of the best Php tuts going around. Would love to see more advanced Php videos. Keep it up 👍🏻

    • @ProgramWithGio
      @ProgramWithGio  2 роки тому +1

      Thank you. The second and third sections contain more advanced videos. There is a link in the description to the GitHub repo that lists all videos in the series.

  • @khansawidhani9899
    @khansawidhani9899 6 місяців тому

    I am new to php but not to programming. No doubt this course is a complex one and so quick but still I love it because you skipped nothing and discussed everything.
    I still don't believe that how you never skipped any point. You are the real dude of PHP. I envy the juniors who works under you because they are lucky to have such a wonderful mobile chatgpt of PHP like you.
    I have never seen any language 's tutorial this much detailed. People used to cover simpler things but you are really something.
    trust me this playlist will gonna have more or infinite views because you really put great efforts to gather this much info at one place. REALLY HELPFULL❤❤
    The fun fact is your 5 min video takes my 20 minutes to watch and practice takes some other time but the doesn't matter as long as your content is whoa!!! Loved it.

    • @ProgramWithGio
      @ProgramWithGio  5 місяців тому

      Thank you, that means a lot to me. Yea I talk fast & have made mistakes during editing but am constantly improving. I like to be more detailed because when I learn something new I like to get as much details as I can and it's not easy to find tutorials that go in that much detail, most just cover the surface or basics.

    • @khansawidhani9899
      @khansawidhani9899 5 місяців тому

      @@ProgramWithGio this is what makes your content special

  • @hugor778
    @hugor778 9 місяців тому +1

    Just love my evenings with Gio 📚📖

  • @BipsonMukhiya
    @BipsonMukhiya 7 місяців тому +1

    your course have lot of complexity and you are going by your own pace

    • @ProgramWithGio
      @ProgramWithGio  7 місяців тому

      There are many other courses that you could try

  • @SoniaChavez-je7hq
    @SoniaChavez-je7hq 2 дні тому

    Very good video ! thank you for the effort

  • @octavian1830
    @octavian1830 3 роки тому +4

    Only halfway through, amazing guide thank you!!!

  • @lucassimas1019
    @lucassimas1019 7 місяців тому

    thanks for all man, you´re the best!!!

  • @tawfiqsict
    @tawfiqsict 3 роки тому +1

    Thank you very much. Best tutorial on PHP arrays ever made !
    Greetings from Bangladesh.

    • @ProgramWithGio
      @ProgramWithGio  3 роки тому

      Greetings 👋. You're welcome and thank you 🙌

  • @ahmaddokmak5500
    @ahmaddokmak5500 Рік тому +3

    Thank you very much for the great efforts put in this great course. I enjoy every minute of it.

  • @claudiofilho7184
    @claudiofilho7184 Рік тому

    This course is amazing! Thank you very much, you are helping me a lot in this new area that I have just entered! Greetings from Brazil, my friend!

  • @astragor705
    @astragor705 5 місяців тому

    dude, u're extremly awesome

  • @Zubbee
    @Zubbee 2 роки тому

    Wow. It's now I'm seeing that we worked with some of these array functions. So handy to be familiar with array functions.
    Didn't know I didn't comment on this lesson. sai! Thanks alot Gio

    • @ProgramWithGio
      @ProgramWithGio  2 роки тому

      It has certainly been a long journey, glad you like it

  • @lotuslando1994
    @lotuslando1994 2 роки тому

    This tutorial on array functions was very chewy, in a good way. Working that spaceship operator into the callback function really helps me to understand how to use it. is till a bit abstract to me, but your examples and explanations are making it much easier to grasp.
    Looking forward to putting all this foundational knowledge into use in a project!
    Thanks again for making this course available to everyone.

    • @ProgramWithGio
      @ProgramWithGio  2 роки тому

      You're welcome & thank you, glad you liked it 🙌

  • @JonasHerbertson
    @JonasHerbertson 2 роки тому

    Great video! Many thanks! :)

  • @solutionarium9731
    @solutionarium9731 2 роки тому

    Thanks for adding time stamps. They are very convenient.

    • @ProgramWithGio
      @ProgramWithGio  2 роки тому

      You're welcome. I try to add them in lessons where it makes sense.

  • @Vitalii-m6r
    @Vitalii-m6r Рік тому

    I have learned a lot from your videos. Thanks a million!

  • @emekatimothyiloba699
    @emekatimothyiloba699 Рік тому

    Thank you Gio. Please how do you advice we practice while following this wonderful series

    • @ProgramWithGio
      @ProgramWithGio  Рік тому +1

      Write the same code on your own and play around with it

  • @mickharner4301
    @mickharner4301 Рік тому

    3:15 -- Gio says "array keys are not preserved", but as demonstrated, he means to say that the original keys "are preserved".

  • @dostonbek_mominov
    @dostonbek_mominov 2 роки тому +1

    I appreciate all of your hard work, and waiting for some framework tuts in this super mode impatiently.

  • @ieduardoms
    @ieduardoms Рік тому

    Great, thank you so much.

  • @mariocalcetin7602
    @mariocalcetin7602 3 роки тому +1

    Thank you very much friend, I have a hard time understanding this about php.
    Greetings from Chile.

  • @jessieren6476
    @jessieren6476 3 роки тому

    Thank you!

  • @wilbertvanbakel
    @wilbertvanbakel 2 роки тому

    This video is much more comfortable to digest if you don't edit out silence.

    • @ProgramWithGio
      @ProgramWithGio  2 роки тому

      I agree & I apologize, it was an editing mistake on my end. Gets better in third section.

  • @mavetyan
    @mavetyan Рік тому

    I would add explode and implode functions to this lesson. Great content as usual!

  • @developeralimcu
    @developeralimcu 2 роки тому

    Very good and informative tutorial i have ever seen.thank you dear gio.. Keep it up

  • @ינוןאלבז-כ1ז
    @ינוןאלבז-כ1ז 2 роки тому

    Best tutorial on PHP 😍😍😍😍😍

  • @mahmoudtaha827
    @mahmoudtaha827 2 роки тому

    Thank you for your effort in conveying the information.. God bless you

  • @timiade8108
    @timiade8108 3 роки тому +1

    Thanks. Great explanation

  • @UserU-d2v
    @UserU-d2v 2 роки тому

    Thanks. Your video helped me a lot!

  • @FranciscoJunior29
    @FranciscoJunior29 2 роки тому

    Great.

  • @alexandershnaidman8188
    @alexandershnaidman8188 Рік тому

    Great lesson! Thanks!

  • @omaryahia
    @omaryahia Рік тому

    amazing as always ✨

  • @jewgienijbrzozowski8451
    @jewgienijbrzozowski8451 3 роки тому

    Finaly got how to use array_reduce, will also use it more often in JS. Great tut, lets see whats next :)

  • @iqorimane3575
    @iqorimane3575 2 роки тому

    the best

  • @BimashaZaman
    @BimashaZaman 3 роки тому

    Thanks

  • @farhan_aftab
    @farhan_aftab 3 роки тому

    When we compare like with greater than operator php will convert the data type and then do the comparison. is there any way here to do strict comparison ?

    • @ProgramWithGio
      @ProgramWithGio  3 роки тому

      Don't think there is a native way to do strict greater than or less than comparison. However, you could use strict types and accept integers in function for example, that way you know that you are comparing 2 integers. Just be sure to enable strict mode so that if you pass string instead of integer it gives you error. If you don't want strict types then you should at least cast to appropriate data type before comparing, so (int) $x, (int) $y and then $x < $y

    • @farhan_aftab
      @farhan_aftab 3 роки тому

      @@ProgramWithGio Thanks

  • @subjectfrank
    @subjectfrank 2 роки тому

    can we make destructuring with associative arrays too?

  • @udayan285
    @udayan285 Рік тому

    Very helpful tutorial .

  • @codingtalkies4749
    @codingtalkies4749 4 роки тому +2

    thanks for the video

  • @rosarioveneruso9928
    @rosarioveneruso9928 3 роки тому

    Cant' get how usort works, I googled and seen the docs but still is unclear.
    What is not clear is $a and $b who are exactly? How does it work? It's an array of four elements so I understand that if I have 2 arguments and I need to sort all 4 elements usort loops it through? Once for example I start with 3 equal to 3 is 0 , this zero what does it means? After we have 3 > 1 so it returns 1 , true so being greater it will have a greater position in the new array and so on for the other elements?

    • @ProgramWithGio
      @ProgramWithGio  3 роки тому +3

      $a and $b are 2 elements from array that you are comparing, if $a is < $b then you return -1 meaning that $b is higher, if $a is > $b then you return 1 because $a is higher, if they are equal you return 0. usort loops through it basically & passes the 2 elements into the callback for which you write the comparison for & decide how they should be compared. (-1, 0 and 1 are just values that determine how element should be sorted in the array)

    • @rosarioveneruso9928
      @rosarioveneruso9928 3 роки тому

      @@ProgramWithGio ok it is clearer, thank u so much gio, really , u've done a wonderful job with this course!

    • @ProgramWithGio
      @ProgramWithGio  3 роки тому +1

      @@rosarioveneruso9928 you're welcome. Thank you 🙌

  • @bradcasper4823
    @bradcasper4823 2 роки тому

    10:53
    my code:
    $ar1 = ['a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5];
    $ar2 = ['f'=>4,'g'=>5,'g'=>6,'h'=>7,'i'=>8];
    $ar3 = ['l'=>3,'m'=>9,'n'=>10];
    $new_ar = array_diff($ar1,$ar2,$ar3);
    output:
    array(3) {
    ["a"]=>
    int(1)
    ["b"]=>
    int(2)
    ["e"]=>
    int(5)
    }
    why does it show ["e"]=>int(5) if 5 is present in $ar2? I'm confused because I can't get the same output with the same code.

    • @bradcasper4823
      @bradcasper4823 2 роки тому

      Pardon, now I see, both 5 and 6 has id of 'g', that's why.

    • @ProgramWithGio
      @ProgramWithGio  2 роки тому

      Yup, sorry for the late reply, UA-cam marked it as a spam for some reason, just found it. But yes you are correct because the key is same 'g' the second one overwrites first so you end up with 'g' = 6

  • @benderbg
    @benderbg 7 місяців тому

    This lesson was 10 pages long with 25+ examples!

    • @ProgramWithGio
      @ProgramWithGio  7 місяців тому

      Each of these videos took a lot of effort & time to make :)

  • @prajwalsiwakoti9866
    @prajwalsiwakoti9866 2 роки тому

    super helpful. But i think we may need a detailed video of array functions and with a slow pace :P

  • @abdelrahmanyosry9185
    @abdelrahmanyosry9185 2 роки тому

    great work

  • @AxxionMarketPlace-iu6ri
    @AxxionMarketPlace-iu6ri Рік тому

    Thank you

  • @bernardchisumo4054
    @bernardchisumo4054 3 роки тому

    what is difference between implode and explode

    • @ProgramWithGio
      @ProgramWithGio  3 роки тому +1

      Implode joins array into a string while explode splits string into an array

  • @AliHassan-wc6nb
    @AliHassan-wc6nb 3 роки тому

    Great!

  • @omaryahia
    @omaryahia Рік тому

    edit:
    oh maan
    now I get it, 'fn' is a keyword in php, for declaring anonymous functions
    I thought it was just a random function name
    __________________
    I am getting an error, with the arrow function inside the array_reduce
    unexpected =>
    although it is the same code as your's
    I don't know what am I missing

    • @ProgramWithGio
      @ProgramWithGio  Рік тому

      Heh, yup fn is a keyword, glad you figured it out 👍

  • @farhan_aftab
    @farhan_aftab 3 роки тому

    Difference between Language construct vs functions ?

    • @ProgramWithGio
      @ProgramWithGio  3 роки тому +1

      Language structs are keywords kind of hardcoded to PHP, also known as tokens. Things like if/else, isset(), echo() are structs for example. You can see list of keywords here: www.php.net/manual/en/reserved.keywords.php

  • @pmmachadov
    @pmmachadov Рік тому

    Hello. Thank you for the video. Do you know where is the link to download the code of the course. The guide you provided is a guide of the topics but I would like to get the complete course code.

    • @ProgramWithGio
      @ProgramWithGio  Рік тому +1

      Hello. There is no source code for some of these topics. Later in the course we work on project and link to repo is in the description of those videos. Keep watching and you'll get there

    • @pmmachadov
      @pmmachadov Рік тому +1

      @@ProgramWithGio Thank you for the course and for the answer!

  • @ZeeshanMRaje
    @ZeeshanMRaje 3 місяці тому

    I am at 8:55

  • @astragor705
    @astragor705 5 місяців тому

    speedrunning PHP in 1-2 monthes in order to get job

  • @lovietech3885
    @lovietech3885 3 роки тому

    Is there anything like this in php as how it is in python without using loop;
    num = [4, 7, 9, 0, 2]
    print num[0:2]
    This is to print from index 0 to index 2 which the output is 4, 7, 9

  • @sym2574
    @sym2574 Рік тому

    🙆‍♂

  • @orenders
    @orenders Рік тому

    no no no, im only learn things and you told me arrow array fun inside array fun... what the hell, why you complicate this so much. Must find simplified explanation.
    ...you can also start from 500 ....WHY? What for ???
    i think you are tired to explain thing and just doing bla bla bla... to start new video asap.

    • @ProgramWithGio
      @ProgramWithGio  Рік тому

      Seems like this series is not for you. Feel free to watch something else. Arrow function is just another type of function which we covered earlier, so maybe you missed that video or you skipped it? I also don't understand what you mean by 500, can you be more specific?
      If you are here to just complain, then move on to other videos, there are plenty of PHP videos on UA-cam so hope you find something that is more suited for you. Cheers

  • @memack101
    @memack101 2 роки тому

    Thanks

  • @ilya_123__
    @ilya_123__ Рік тому

    thank you!