About uploading CSV files in PHP.

Source: Internet
Author: User
About uploading CSV files in PHP .... If there are more than 13 records, the system will fail to resolve them. an error will be reported directly in blank spaces. is it an environment configuration problem or something? ask for help .. Error & lt ;? Php & nbsp; exit ;? & Gt; 01-02 & nbsp; 10:49:16 & nbsp; | & nbsp; 2 & nbsp; | & nbsp; fopen () & nbsp; [& lt; a & nbsp; h. about uploading CSV files in PHP ....
If there are more than 13 records, the system will fail to resolve them. an error will be reported directly in blank spaces. is it an environment configuration problem or something? ask for help ..


Error

01-02 10:49:16 | 2 | fopen() [function.fopen]: Filename cannot be empty |
01-02 10:49:16 | 2 | fgetcsv() expects parameter 1 to be resource, boolean given | 
01-02 10:49:16 | 2 | fclose() expects parameter 1 to be resource, boolean given | 






 $file=$_FILES["file"]; 
 $file_type = substr(strstr($file['name'],'.'),1);
 setlocale(LC_ALL, 'zh_CN');
 $row=1;
 $handle = fopen($file['tmp_name'],"r");
 while ($data = fgetcsv($handle,1000,',')){
 print_r($data);
  $row++;
           }  
Share: More

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.