I have this string:
[{"position":"1d","number":10,"nb_plot1":12,"max_actions":3}
{"position":"2d","number":7,"nb_plot1":15,"max_actions":30}
{"position":"3d","number":100,"nb_plot1":2,"max_actions":5}]
and i need to obtain two different string with different format like this:
for numbers:
[10,7,100]
for positions:
['1d','2d','3d']
and cut unnecesarry strings.
I’m a noob sorry.
Decode the string in a array with json_decode.
Iterate over this array and build new arrays for numbers and position.
Encode the arrays.
In code: