NOTE : This is for a PHP script !
So I've been working on a program but I right now I am stuck because I can't split the data right.
I have a list with numbers just like this :
50.0.1 581 50.0.2 545 50.0.3 541 50.0.4 18 50.0.5 2 50.0.6 33 50.0.7 1 [...]
I have add that information into an ARRAY or JSON format (preferable JSON).
The main data looks like this (we take groups): 50.0.1 581 so basically I have to split 50.0.1 from 581 add it to JSON/ARRAY and then move to the next group that in our case is 50.0.2 545. (and so on)
Example JSON:
{"result": {
"50.0.1": "581",
"50.0.2": "545"
}}
Note : First value will always have the same format : [0-9]{2}.[0-9].[0-9] (ex : 50.0.1)
However, the second value can be 1 to 4 digit long : [0-9]{1,4}.
I am sorry if I did not make myself clear - it is quite hard to explain. Will add more example if required !
Thank you very much !