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

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 125

  • @ragadiveluka
    @ragadiveluka 2 года назад +25

    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!!!

  • @jipeejoce1353
    @jipeejoce1353 3 года назад +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  3 года назад +6

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

  • @khansawidhani9899
    @khansawidhani9899 Месяц назад

    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  16 дней назад

      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 16 дней назад

      @@ProgramWithGio this is what makes your content special

  • @hugor778
    @hugor778 4 месяца назад +1

    Just love my evenings with Gio 📚📖

  • @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.

  • @Armando-px8hi
    @Armando-px8hi Год назад +1

    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.

  • @BipsonMukhiya
    @BipsonMukhiya 2 месяца назад +1

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

    • @ProgramWithGio
      @ProgramWithGio  2 месяца назад

      There are many other courses that you could try

  • @octavian1830
    @octavian1830 3 года назад +4

    Only halfway through, amazing guide thank you!!!

  • @ahmaddokmak5500
    @ahmaddokmak5500 Год назад +3

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

  • @astragor705
    @astragor705 11 дней назад

    dude, u're extremly awesome

  • @lucassimas1019
    @lucassimas1019 Месяц назад

    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 🙌

  • @wilbertvanbakel
    @wilbertvanbakel Год назад

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

    • @ProgramWithGio
      @ProgramWithGio  Год назад

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

  • @claudiofilho7184
    @claudiofilho7184 7 месяцев назад

    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!

    • @ProgramWithGio
      @ProgramWithGio  7 месяцев назад

      Great to hear, welcome & thank you 💙

  • @mariocalcetin7602
    @mariocalcetin7602 3 года назад +1

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

  • @memack101
    @memack101 2 года назад

    Thanks

  • @solutionarium9731
    @solutionarium9731 Год назад

    Thanks for adding time stamps. They are very convenient.

    • @ProgramWithGio
      @ProgramWithGio  Год назад

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

  • @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

  • @jessieren6476
    @jessieren6476 3 года назад

    Thank you!

  • @mavetyan
    @mavetyan Год назад

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

  • @user-mo3cw6go7c
    @user-mo3cw6go7c Год назад

    Best tutorial on PHP 😍😍😍😍😍

  • @ieduardoms
    @ieduardoms Год назад

    Great, thank you so much.

  • @mickharner4301
    @mickharner4301 7 месяцев назад

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

  • @lotuslando1994
    @lotuslando1994 Год назад

    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  Год назад

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

  • @dostonbekmuminov6136
    @dostonbekmuminov6136 2 года назад +1

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

  • @timiade8108
    @timiade8108 3 года назад +1

    Thanks. Great explanation

  • @JonasHerbertson
    @JonasHerbertson Год назад

    Great video! Many thanks! :)

  • @user-zh2oz9fe4m
    @user-zh2oz9fe4m Год назад

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

  • @iqorimane3575
    @iqorimane3575 Год назад

    the best

  • @mahmoudtaha827
    @mahmoudtaha827 2 года назад

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

  • @alexandershnaidman8188
    @alexandershnaidman8188 10 месяцев назад

    Great lesson! Thanks!

  • @benderbg
    @benderbg 2 месяца назад

    This lesson was 10 pages long with 25+ examples!

    • @ProgramWithGio
      @ProgramWithGio  2 месяца назад

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

  • @FranciscoJunior29
    @FranciscoJunior29 2 года назад

    Great.

  • @udayan285
    @udayan285 10 месяцев назад

    Very helpful tutorial .

  • @user-fw2pp5zg2q
    @user-fw2pp5zg2q 2 года назад

    Thanks. Your video helped me a lot!

  • @jewgienijbrzozowski8451
    @jewgienijbrzozowski8451 2 года назад

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

  • @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

  • @codingtalkies4749
    @codingtalkies4749 3 года назад +2

    thanks for the video

  • @developeralimcu
    @developeralimcu 2 года назад

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

  • @AxxionMarketPlace-iu6ri
    @AxxionMarketPlace-iu6ri Год назад

    Thank you

  • @omaryahia
    @omaryahia Год назад

    amazing as always ✨

  • @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 🙌

  • @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

  • @AliHassan-wc6nb
    @AliHassan-wc6nb 2 года назад

    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 👍

  • @prajwalsiwakoti9866
    @prajwalsiwakoti9866 2 года назад

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

  • @bradcasper4823
    @bradcasper4823 Год назад

    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 Год назад

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

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      Yup, sorry for the late reply, RUclips 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

  • @subjectfrank
    @subjectfrank 2 года назад

    can we make destructuring with associative arrays too?

  • @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

  • @bernardchisumo4054
    @bernardchisumo4054 2 года назад

    what is difference between implode and explode

    • @ProgramWithGio
      @ProgramWithGio  2 года назад +1

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

  • @abdelrahmanyosry9185
    @abdelrahmanyosry9185 Год назад

    great work

  • @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!

  • @lovietech3885
    @lovietech3885 2 года назад

    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 Год назад

    🙆‍♂

  • @astragor705
    @astragor705 11 дней назад

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

  • @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 RUclips so hope you find something that is more suited for you. Cheers

  • @BimashaZaman
    @BimashaZaman 2 года назад

    Thanks

  • @ilya_123__
    @ilya_123__ 11 месяцев назад

    thank you!