• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How can i use some of the json elements in json array (not all of elements)

Resolved: How can i use some of the json elements in json array (not all of elements)

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

i want to create dynamic json array.
i am using this array :
and i can decode this json and using it in my project.
But now i have to take some of them in this array. For example i have to use key3 and key5 and rebuild my json array.

Answer:

You can use array_intersect_key:
Result:
If you want to get fancy, you could also add in array_flip:

If you have better answer, please add a comment about this, thank you!

json php
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: VBA – Applying border around the areas with value/text

01/04/2023

Resolved: How can I implement a function depending on picked up items?

01/04/2023

Resolved: Azuer Service Bus SDK not receiving the specified messages

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.