Created by: Herrick19
If the $data is an invalid Json (for example, add an extra comma after the last property) or if data is not an array, php gives error:
Invalid argument supplied for foreach() at line 257 (Now line is 262)
This is my fist git pull request so please pardon me if I did something wrong.
Best Regards