After PHP imports Excel into MySQL database, how to make it appear in text form
Like in Excel, it's 9787509345030.
After importing the database, it becomes 9.78750934503E+12.
PHP to read the database data, found also 9.78750934503E+12
To be annoyed, to ask for help, the mood is very complicated.
It seems to be a numerical type, I am obviously
$number = Implode ("', Explode ('-'), $data->sheets[0][' cells '] [$i][1]));
$number = Strval ($number);
Make it into a string type, why is the meter or numerical type????
Reply to discussion (solution)
Your 9787509345030 is not stored as a string in Excel (' 9787509345030 '), but rather as a stylesheet-style (otherwise it is scientific notation)
You can try to read by using the GetFormattedValue method instead of the GetValue method
Your $data->sheets[0][' cells ' [$i][1] There's a problem.
I am csdn a person to learn the wording of the
$data = new Spreadsheet_excel_reader ();
$data->setoutputencoding (' utf-8 ');
$data->read ($upload _file_name);
for ($i = 2; $i <= $data->sheets[0][' numrows '); $i + +)
{
$user _name = $_session[' user_name ');
$book _ISBN = $data->sheets[0][' cells '] [$i][1]));
$book _name = $data->sheets[0][' cells ' [$i][2];
$book _press = $data->sheets[0][' cells ' [$i][3];
}
How did you write it, please?
Formatted read how to write, I looked at the official PHP file to me, I did not read.