I am still a newbie to PHP, and I have a foreach loop issue. The section of code is the following:
Code:
foreach($word[0] as $value)
{
foreach($num[0] as $value2)
{
$tags = array('<td>','</td>','<td width=\'85\'>','<td align=right>');
echo str_replace($tags, "",$value)." ".str_replace($tags, "",$value2)."<br>".$vbCrLf;
}
}
The echoed results show each word ($value) as expected, but the number ($value2) next to each word is the same. For example:
word1 45
word2 45
word3 45
After it loops througn each word, it then echoes the first word, with the numbers changing as they should. For example:
word1 65
word1 49
word1 23
I am trying to get the result to show each word next to each number like:
word1 65
word2 49
word3 23
I tried using arrays to no success, finding I couldn't put the values of $word[0] and $num[0] into an array correctly if it's even possible. PHP Gurus, I would greatly appreciate any suggestions to this problem. Thanks!
|