Skip to content
Advertisement

How to align comments under its posts via PHP

I have two json records which I can successfully display its records separately.

Here is my issue. I want to append and display the comments of the second record based on the postid of the first record.

That is, I want to place all the comments under its post based on the postid.

JavaScript

Advertisement

Answer

You need to add second json_decode, and inside loop take comments from that.

JavaScript

Output

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