Flattening A PHP Multidimensional Array

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 31

  • @codecourse
    @codecourse  9 років тому +8

    ua-cam.com/video/2hKnJec0qGw/v-deo.html

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

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

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

  • @abdmaster
    @abdmaster 9 років тому +3

    Nice useful thing learned today. Thank you.

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

  • @CristianAlexandruRadu
    @CristianAlexandruRadu 9 років тому +1

    very useful tutorial!!!

    • @codecourse
      @codecourse  9 років тому +1

      Thanks, glad you found it helpful.

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

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

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

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

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

  • @enochkandiah6445
    @enochkandiah6445 6 років тому

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

  • @adilismail3593
    @adilismail3593 6 років тому

    What can we do instead of continue

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

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

  • @saurabhsuri3879
    @saurabhsuri3879 4 роки тому

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