0
$array1 = ['Hello', 'World'];
$array2 = ['Hello Girl', 'Hello Boy'];
foreach($array1 as $text)
{
echo $text;]
}
0
$array1 = ['Hello', 'World'];
$array2 = ['Hello Girl', 'Hello Boy'];
foreach($array1 as $text)
{
echo $text;]
}
1
<?php
$array = ['Hello', 'World'];
$array2 = ['Hello Girl', 'Hello Boy'];
foreach($array as $indice => $text)
{
echo $text;
echo $array2[$indice];
}
?>
This way will be printed the $array
and then the $array2
Thanks Vinicius De Jesus, but what if I wanted to do with a form using 2 inputs ? I will edit the question by putting inputs.
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
It depends a lot on the case, it goes from having 2 foreach or until it fits in the situation a for/foreach and an Indice to control the items.
– rray