Home > Backend Development > PHP Tutorial > 关于PHP上传CSV有关问题。

关于PHP上传CSV有关问题。

WBOY
Release: 2016-06-13 12:30:31
Original
1001 people have browsed it

关于PHP上传CSV问题。。。。
超过13条就解析不了,直接空白报错,是环境配置问题还是什么,求助。。


报错

<br />
<?php exit;?>01-02 10:49:16 | 2 | fopen() [<a href='function.fopen'>function.fopen</a>]: Filename cannot be empty |<br />
<?php exit;?>01-02 10:49:16 | 2 | fgetcsv() expects parameter 1 to be resource, boolean given | <br />
<?php exit;?>01-02 10:49:16 | 2 | fclose() expects parameter 1 to be resource, boolean given | <br />
Copy after login

<br />
<form name="myform" id="myform" action="index.php?m=price&c=index&a=insertalldo" method="post" enctype="multipart/form-data"><input name="pc_hash" type="hidden" value="4GxoOl"></form><br />
Copy after login


<br />
 $file=$_FILES["file"]; <br />
 $file_type = substr(strstr($file['name'],'.'),1);<br />
 setlocale(LC_ALL, 'zh_CN');<br />
 $row=1;<br />
 $handle = fopen($file['tmp_name'],"r");<br />
 while ($data = fgetcsv($handle,1000,',')){<br />
 print_r($data);<br />
  $row++;<br />
           }  <br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template