I think giving some more information about what you try to archieve and what you already have would be better for the response. Could you maybe tell if you already getting the data, how you are getting the data(format).
Its simple if you are using a framework like laravel, in controller fetch the data from the database, afther that return the response view with the data included. In the response view you could the loop trough the results and echo them. But as i said before i have no clue about the way you are developping this.
2
solved How to display like this format in PHP