You could do this in three steps:
- set cell value
- set datatype of this cell to
string2
- set url link to this text value
$sheet->setCellValue('M'.($results+2),$result['headline']);
$sheet->getCell('M'.($results+2))->setDataType(PHPExcel_Cell_DataType::TYPE_STRING2);
$sheet->getCell('M'.($results+2))->getHyperlink()->setUrl(strip_tags($result['url']));
In one line it would looks like:
$sheet->setCellValueExplicit('M'.($results+2), $result['headline'], PHPExcel_Cell_DataType::TYPE_STRING2, TRUE)
->getHyperlink()
->setUrl(strip_tags($result['url']));
setCellValueExplicit() - similar to getCell(), if setted to true
returns the cell instead of the sheet (similar to getActiveSheet()).