Flattening A PHP Multidimensional Array

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • Want more? Explore the library at www.codecourse...
    Official site
    www.codecourse...
    Twitter
    / teamcodecourse

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

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

    The best of php recursion tutorials in a whole page of youtube search results!

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

    Hi, You just save my life :) I was having lots of problems going through a JSON array multiple levels and this video helped me to understand how to solve my problem!

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

    freaking awesome!!!!....might say i was running into this problem alot where the return data was in different arrays of multidimension. Was really looking for a way to have the data returned as a single array so i can loop through each one or compare with another array. As a junior developer i cant thank you enough

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

    Great tutorial! Nice and quick and very informative. Thank you.

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

    Nice useful thing learned today. Thank you.

    • @codecourse
      @codecourse  9 ปีที่แล้ว

      Excellent to hear!

  • @nielsofficeofficial9706
    @nielsofficeofficial9706 2 ปีที่แล้ว

    Please have you link repo for this? This is really great and awesome! :)) Thanks

  • @devope
    @devope 3 ปีที่แล้ว

    7:31 what would be if you didn’t use “continue”

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

    As a junior developer, when might this technique be useful?

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

      The only example I could think of was the flattening of some sort of message bag that holds lots of different messages for all keys. e.g. for validation errors, they may be under different keys (username field might have two errors, email might have one). You could then implement an all() method to just grab all errors regardless of keys. This video originally stemmed from the use of the latter method in Violin, which is the validation package I maintain on GitHub. Check it out and you'll see where it's used: github.com/alexgarrett/violin

  • @enochkandiah6445
    @enochkandiah6445 6 ปีที่แล้ว

    can u try to use these on websites, i have difficulties..

  • @adilismail3593
    @adilismail3593 6 ปีที่แล้ว

    What can we do instead of continue

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

    thank ou man, ou safe my life, o como se diga jajaja, saludos desde chile!!!!

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

    very useful tutorial!!!

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

      Thanks, glad you found it helpful.

  • @tekreme73
    @tekreme73 9 ปีที่แล้ว

    Nice tut Alex !
    But please, don't use "continue" to this type of loop !
    Just add "else" to your "if" statement to ignore if its not an array

    • @TheGryphon14
      @TheGryphon14 9 ปีที่แล้ว

      tekreme73 why not? nothing's wrong with that.

    • @codecourse
      @codecourse  9 ปีที่แล้ว

      I don't like using if else where it's not necessary.

    • @tekreme73
      @tekreme73 9 ปีที่แล้ว

      ***** But it could be better and friendly to use "else". Instead of using this ugly "continue" thing

  • @MrGoatsy
    @MrGoatsy 9 ปีที่แล้ว

    I am wondering if you can help me with something.
    I used the uploading system you said and edited so that it only works with image extensions, now is the problem that I can still mask a PHP file as a JPEG, I know you can find this out with exif stuff, but I can't figure out how.
    Can you make a tutorial about that?
    I would like to see it pretty soon, since I am going to probably use it for school stuff.

    • @mondocondo
      @mondocondo 9 ปีที่แล้ว

      If I have understood this correctly, inside the image.php (example filename) file masking the image something along the lines of:

  • @chrispineotaalo7345
    @chrispineotaalo7345 9 ปีที่แล้ว

    Hi... I can see you have changed your server from localhost to tutorial.dev:8000. How did you do that?

    • @leok284
      @leok284 6 ปีที่แล้ว

      you can use something like Laravel Valet to create localhost domain names like http(s)://foldername.dev or .app :)

  • @abdelouery4114
    @abdelouery4114 9 ปีที่แล้ว

    Very Good Tutorial, One question: what is the font and the colorscheme are you using in sublime text?

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

      Thanks. Theme is Mac Classic.

    • @abdelouery4114
      @abdelouery4114 9 ปีที่แล้ว

      Thank you; what about the font? :)

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

      Abdel Ouery I guess it's Consolas, if it still have relevance

  • @saurabhsuri3879
    @saurabhsuri3879 4 ปีที่แล้ว

    Std library of PHP is a whole lot of confusion and mess.

  • @codecourse
    @codecourse  9 ปีที่แล้ว +8

    th-cam.com/video/2hKnJec0qGw/w-d-xo.html