Skip to content
Advertisement

how to give name to sub array in php

I have got the final array with blog detail and related multiple comments for blog

JavaScript

The result of the above code is as follow

JavaScript

But the expected result should look like the following, Comments and blog details should be in the same array

JavaScript

Is there a way to give a name for a comment?

Advertisement

Answer

Try this

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement