I am writing in PHP. I have this string:
'[["<span class=\"highlighted\" style=\"background-color: yellow;\"></span>","This is example filler text","3:1",4,37],["<span class=\"highlighted\" style=\"background-color: yellow;\"></span>"," Filler text is an example usage of a highlighter JQuery plugin utilized for a drupal module. \n ","5:1",5,85],["<span class=\"highlighted\" style=\"background-color: yellow;\"></span>","Highlights are serialized to when \"save\" button is pressed. \n ","5:3",0,108],["<span class=\"highlighted\" style=\"background-color: yellow;\"></span>","The serialized J","5:5",0,16]]'
The above string, is simply a string of a JavaScript style array of arrays. What I would like to be able to do, is convert this to an actual PHP array. But I would also like to be able to convert that PHP array back to this exact string.
The end result would be similar to the end result of doing these steps (I think):
1) remove the first and last single quotation marks
2) replace each '[' character with 'array(' and each ']' character with ')'
Thus I would end up with a valid PHP array of arrays. And I am also unsure of what I would need to do to reverse this process.
json_decode?stdClassPHP objects, associative arrays, or indexed arrays in PHP.[v, v, v]. The string contains JSON.