DEV Community

Discussion on: how I do Multidimensional foreach loop array to json object conversion in php

abhinav1217 profile image
Abhinav Kulshreshtha

It seems that data you are getting is not is the cause of error. vendor_product_details are not properly linked to subcategory. Remember PHP arrays are a trick .

Here is a thought, Try dumping the array itself and see if nested keys are what you wanted. print_r() should be still available even though I would prefer you use some proper debugging tool like Symphony:Dump . It would give more detailed insight.