$imgData = array();
$imageFilePath='./imagestest/'.date('Ymd').'/';//图片在本地存储的路径
if (! file_exists ( $imageFilePath ))
{
mkdir("$imageFilePath", 0777, true);
}
//处理图片
foreach($sheet->getDrawingCollection() as $key => $img)
{
list($startColumn,$startRow) = PHPExcel_Cell::coordinateFromString($img->getCoordinates()); //获取图片所在行和列
$imageFileName = $img->getIndexedFilename();
if(!file_exists($imageFilePath.$imageFileName)){
@copy($img->getPath(),$imageFilePath.$imageFileName);
}
$startColumn = ABC2decimal($startColumn);//由于图片所在位置的列号为字母,转化为数字
$imgData[$startRow-1][$startColumn][] = $imageFilePath.$imageFileName; //把图片插入到数组中
}