images; $randomnumber = rand(0, (count($images)-1)); $i = 0; foreach ($images as $image) { if ($randomnumber == $i) { echo "{$image->description}\n"; } $i = $i + 1; } ?>