Using PHP to turn Excel to HTML solution

Source: Internet
Author: User
Use PHP to turn Excel to HTML
To implement a feature that turns various documents (PDF,EXCEL, etc.) into HTML, you can understand the need for online document previews.
There's no problem with PDF to HTML at the moment, but Microsoft's docs like Excel haven't been able to do it yet, and want to find some open source software that can be used. (All of them have a little difficulty in parsing)

The younger brother beginner PHP, also hope has the experience friend many advice, extremely appreciates.

------Solution--------------------
PHP can read the CSV format in Excel, after obtaining the data, you can make the HTML layout according to your requirements:
PHP Code
$row = 1; $handle = fopen ("Test.csv", "R"), while ($data = Fgetcsv ($handle, +, ",")) {    $num = count ($data);    echo "


\ n "; $row + +; for ($c =0; $c < $num; $c + +) { echo $data [$c]. "
\ n "; }} Fclose ($handle);
------Solution--------------------
http://www.iteye.com/topic/333676
------Solution--------------------
How did you fix it, send it out and share it?
------Solution--------------------
Phpexcel to parse the data out. The method of converting to HTML requires its own operation.

  • 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.