I have an array with name $name[] and another one with the name $content[] Both arrays have equal objects ( 3 ). The $content[] array may have 0, 1 or 2 messages as seen below.
My aim is to echo the $name[0] with the $content[0] and so on. The name will be printed first and after the available messages. I tried to use array_combine without luck.
What is a way to do this?
$name[]
Array
(
[0] =>
[1] =>
[2] =>
)
$content[]
Array
(
[0] => Array
(
[0] => Array
(
[message] =>
)
)
[1] => Array
(
)
[2] => Array
(
[0] => Array
(
[message] =>
)
[1] => Array
(
[message] =>
)
)
)
Really no idea what you’re trying to do; the question isn’t very clear. What’s your expected output?
Here’s my stab in the dark: