if ( $cell ->hasHyperlink()) { |
$worksheet ->writeUrl( $row , $column , |
str_replace ( 'sheet://' , 'internal:' , |
$cell ->getHyperlink()->getUrl()), |
$cell ->getValue(), $formats [ $styleHash ]); |
} |
else { |
$worksheet ->write( $row , $column , $cell -> |
getValue(), $formats [ $styleHash ], $style -> |
getNumberFormat()->getFormatCode()); |
} |
改为 if ( $cell ->hasHyperlink()) { |
$worksheet ->writeUrl( $row , $column , |
str_replace ( 'sheet://' , 'internal:' , |
$cell ->getHyperlink()->getUrl()), $cell -> |
getValue(), $formats [ $styleHash ]); |
} else if ( $cell ->getDataType() == |
PHPExcel_Cell_DataType::TYPE_STRING ) { |
$worksheet ->writeString( $row , $column , $cell -> |
getValue(), $formats [ $styleHash ]); |
} |
else { |
$worksheet ->write( $row , $column , $cell -> |
getValue(), $formats [ $styleHash ], $style -> |
getNumberFormat()->getFormatCode());} |