When PHP imports Excel into MySQL database, how to make it appear as text

Source: Internet
Author: User
After PHP imports Excel into MySQL database, how to make it appear in text form
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
= Implode ("', Explode ('-'), $data->sheets[0][' cells '] [$i][1]));
= Strval ();
Make it into a string type, why is the meter or numerical type????
------to solve the idea----------------------
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.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.