Тёмный

PHP Code Challenge - Flatten an Array 

Gary Clarke
Подписаться 17 тыс.
Просмотров 468
50% 1

Do you know how to flatten a PHP array whilst still preserving the key names? Have a go at this challenge!!
This challenge is taken from my Testing PHP course. You can check it out here:
www.garyclarke...
🆓 Join garyclarke.tech for course DISCOUNTS and your FREE Docker + PHP course (worth $49)
www.garyclarke...
Here is the repo for more challenges
github.com/Gar...
👇 Follow me on Social Media:
Twitter: / garyclarketech
Linkedin: / garyclarketech
💕Show support:
www.paypal.com...

Опубликовано:

 

22 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
@spaceyraygun
@spaceyraygun 4 месяца назад
i've had to do this for many datasets, but in an effort to prevent key collisions/overwrites, i've always opted to preserve the parent key as part of the flattened key for the children with a dot separator. ie: `nested_array.key_three`. i've never used these SPL classes to do it though, might have to look into that!
@thrldr3106
@thrldr3106 4 месяца назад
Cool trick, very insightful. Although I wouldn't probably use it in production code since it's a bit cryptic. A good way to flex on your colleagues
Далее
PHP Code Challenge - Countable Objects
2:20
No BS SOLID Principles
51:06
Просмотров 2,5 тыс.
Eco-hero strikes again! ♻️ DIY king 💪🏻
00:48
Running With Bigger And Bigger Lunchlys
00:18
Просмотров 43 млн
REST API basics with the API Guy @JustSteveKing
1:41:54
Why Signals Are Better Than React Hooks
16:30
Просмотров 477 тыс.
Execute Code After a Response is Returned?
14:00
Просмотров 6 тыс.
Only The Best Developers Understand How This Works
18:32
The Only Database Abstraction You Need | Prime Reacts
21:42
Eco-hero strikes again! ♻️ DIY king 💪🏻
00:48