Correct format for strings / numbers beginning with zero?

后端 未结 6 1560
梦谈多话
梦谈多话 2020-12-03 01:31

I\'m trying to use PHP to create a file containing a list of phone numbers. It\'s working OK however if the phone number begins with zero, the digit is dropped from the Exce

6条回答
  •  醉话见心
    2020-12-03 01:44

    This is an old question but I was recently struggling with this issue and I thought it may help someone in the future if I post some additional info here:

    Whilst the above answers are correct, the formatting gets lost when you remove a column or row that is located before the formatted cell.

    The solution that seems to be resistand to that is:

    $cellRichText = new \PHPExcel_RichText($worksheet->getCell($cell));                        
    $cellRichText->createText($cellValue);
    

提交回复
热议问题