PHPExcel - How to set a url

前端 未结 4 803
Happy的楠姐
Happy的楠姐 2021-02-04 06:53

I am isung PHPExcel and have a URL in a string. When doing:

$url = \'http://dx.doi.org/10.1016/j.phymed.2005.11.003\'
$xls = new PHPExcel();
$xls->setActiveSh         


        
4条回答
  •  情歌与酒
    2021-02-04 07:13

    I have found the solution, somehow the url I had was not recognized by excel.

    $url = str_replace('http://', '', $link);
    $xls->getActiveSheet()->getCellByColumnAndRow(1,2)->getHyperlink()->setUrl('http://www.'.$url);
    

    And now it works. Hope this will help.

提交回复
热议问题