如何在一个foreach循环中显示两个数组?

am storing two arrays in one column.first one is images stored as image1*image2*...etc and second one is descriptions as description1*description2*...etc. i want to use these two set of arrays in one foreach loop.Please help.

It does not seem possible by foreach loop. Instead try using for loop. If you are sure both your arrays are of the same size, then try using following code:

for ($i=0; $i<sizeof(array1); $i++) {
     echo $arrray1[$i];
     echo $arrray2[$i];
}

You can't use foreach, but you can use for and indexed access like so.

$count = count($images);
for ($i = 0; $i < $count; $i++) {
    $image = $images[$i];
    $description = $descriptions[$i];
}

You could use array_combine to combine the two arrays and then use a foreach loop.

$images = array('image1', 'image2', ...);
$descriptions = array('description1', 'description2', ...);

foreach (array_combine($images, $descriptions) as $image => $desc) {
  echo $image, $desc;
}

Just reference the key:

foreach ($images as $key => $val) {
    echo '<img src="' . $val . '" alt="' . $descriptions[$key] . '" /><br />';
}