Ecshop export excel data

Source: Internet
Author: User
Ecshop export excel data
Elseif ($ _ REQUEST ['AC'] = 'exec ') {$ user = exec_user (); $ filename = ecs_iconv (EC_CHARSET, 'gb2312 ', 'user information'); header ("Content-type: application/vnd. ms-excel; charset = utf-8 "); header (" Content-Disposition: attachment; filename=$filename.xls "); $ data = "member \ t province \ t City \ t district \ t shipping address \ t partition \ t line \ t salesman \ t business manager \ n "; foreach ($ user as $ item) {$ data. = "$ item [user_name] \ t"; $ data. = "$ item [province] \ t"; $ data. = "$ item [city] \ t"; $ data. = "$ item [district] \ t"; $ data. = "$ item [address] \ t"; $ data. = "$ item [dist_name] \ t"; $ data. = "$ item [thread_name] \ t"; $ data. = "$ item [saleman] \ t"; $ data. = "$ item [manage] \ n";} echo ecs_iconv (EC_CHARSET, 'gb2312 ', $ data ). "\ t"; exit ;}

Print_r ($ user); more than 200 pieces of data are exported; pieces are exported. why? is there a problem with the code? thank you for your advice.


Reply to discussion (solution)

Is the page stuck?
Is the memory allocated to php sufficient?
Is the 200 rows of data normal when the xls file is opened?

The problem is found. it is caused by special characters. thank you.

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.