 <p>Take the substring from the place where DS occurs using the function substr, and get the data out of it. To get the data, just parse the substring keeping a count of opening brackets. When the closing brackets start, keep a count of them. When this count and previous count become equal, you have got your data. </p>