I have a logic-thinking problem. I retrieve data from a php file over json and every thing works fine.
But now I have a little problem. I want to retrieve some headlines. There are main headlines and sub headlines. Each main headline has a (not known) number of sub headlines.
Now I want to pack these headlines all into an array, send them over json to an javascript and put the main headlines with another color as the sub headlines, but the subheadlines should be displayed under the main headlines.
So how should I pack the values into the array, and unpack these? I’ve played arround with the each function (for unpacking) but its at the moment really hard for me to come to a successful solution.
Hope you could gibe me some hints.
Thanks in advance.
Best regards, john
Without knowing a whole lot about the structure of the data:
Would be how I’d structure the PHP array.
Then using jQuery’s $.each() function: