I have strings like this:
$T = '[{"X":"13","Y":"76", "R":"90"},{"X":"12","Y":"24","R":"-19"}]}';
$A = '[{"X":"1","Y":"6", "R":"0"},{"X":"1","Y":"4","R":"9"},
{"X":"12","Y":"24","R":"-19"}]}';
I want to find each X value in the string, and get the value after them.
Note that the number of X values differs.
For example, I want:
13, 12, 1, 1, 12
I tried explode()
, but that only grabbed the first X value (13). I am new to PHP, and don't know an elegant solution. Any suggestions are appreciated.