decomposing json objects and replaced html with php