I have a PHP script which exports data from database to different formats, including as an Excel document. If a text field contains such a value as 123123123123
, Excel, by default converts it to 1.23123E+11
. Is it possible to prevent this absolutely unnecessary behaviour?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
If your goal is to store the number as text (and not do math on it later) and the PHP is exporting as a CSV, a simple solution would be to export the number as a
CONCATENATE
function.=CONCATENATE(123123123123)
renders as123123123123
in text format when the CSV is opened in Excel (this is for Excel 2010).