PHP foreach loop show category name onces json multidimensional array
86
I have an multidimensional array in which there are three fields substitute name,substitute category and price. I have this is on foreach loop. I want to show category name once and under this substitute name.
Array (
[sub1] =>
Array ( [substitute] => 2
[substitute_category] => 7
[substitute_price] => 123 )
[sub2] =>
Array (
[substitute] => 3
[substitute_category] => 7
[substitute_price] => 139
)
[sub3] =>
Array ( [substitute] => 4
[substitute_category] => 7
[substitute_price] => 150 )
)
Answer
Solution:
It ain't that hard.
If you already had the foreach, what exactly is your problem?