Excellent! Many thanks!
In this block of code: There are some cases where the preg_match evaluates to false causing the json_decode() to throw an error. Would be nice to have that fixed to something like:
More