Posted by J Huntley Palmer on 10/01/47 11:41
Sjoerd wrote:
> J Huntley Palmer wrote:
>> How may I concatenate the index respective questions and answers into
>> one string per index using ONE foreach loop? I do not want to use
>> numerical indexes just the named ones as below.
>
> Do you mean this:
>
> for ($i = 0; $i < count($arr[0]); $i++) {
> $result[] = $arr[0][$i].$arr[1][$i];
> }
>
Actually I wanter to use the named indexes such as [QUEST] AND [ANSW]
not the numerical ones.
Array
(
[0] => Array
(
[0] => question0
[1] => question1
)
[QUEST] => Array
(
[0] => question0
[1] => question1
)
[ANSW] => Array
(
[0] => answer0
[1] => answer1
)
[1] => Array
(
[0] => answer0
[1] => answer1
)
)
Thanks
[Back to original message]
|