I have a string that looks like this:
$input_string = '<script>some data =
{
first: [[111,55],[123,66]],
theColor: "#000000",
second: [[111,95],[123,77]]
};
</script>'
As you can see, its a complex string, with some possible garbage, as well as two arrays mixed in. The arrays first dimension are the same in each array, ie, '111' and '123' - this should be the key to the new array created.
So I need to build new arrays, using that key/value pair and produce something like this for the first one:
array() {
'111' =>
array(2) {
'first' =>
string(2) "55"
'second' =>
string(2) "95"
}
}