Skip to content
Advertisement

How to print 2D arrays in a table with key name(just one time) and all it’s values php?

JavaScript

I have this kind of arrays. Now I want to print then in a table with the key name of the main arrays (once) on the table row with its all values. Table I Want is like:

JavaScript

My Code is this which prints all keys together and some values at the end.

JavaScript

Advertisement

Answer

You have to use simple foreach():

JavaScript

Sample output: https://3v4l.org/gFhO7

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