I have following code:
foreach(array_combine($names, $hashids) as $name => $hashid) {
echo '<tr>
<td>'.$counter.'</td>
<td>'.$name.'</td>
<td>'.$hashid.'</a></td>
</tr>';
}
Now I want to combine one more array and iterate it's values in foreach. That's three arrays in a foreach statement. can anyone help me in adding it. Like how can we add multiple arrays in foreach statement.
For example I want something like:
foreach(array_combine($names, $hashids, $photoids) as $name => $hashid => $photoid) {
echo '<tr>
<td>'.$counter.'</td>
<td>'.$name.'</td>
<td>'.$hashid.'</td>
<td>'.$photoid.'</td>
</tr>';
}
But above code gives me error. The error I get is
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')' in /homepages/4/d864452909/htdocs/public_html/app/index.php on line 58
print_r(array_combine($names, $hashids, $photoids) );foreachloop AND share with usArray ( [Sample] => JdpmLLdx5me7K [Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film.mp4] => lWJQjwrVRZdXn )