<?php    
        
         //取数据
        $f_d = file_get_contents('tpl_import_info.csv');
        $f_d = iconv('gbk', 'utf-8', $f_d);
        file_put_contents('tpl_import_info.csv',$f_d);
        setlocale(LC_ALL,'zh_CN.UTF-8');   //解决fgetcsv处理中文失败的问题
        $hl = fopen('tpl_import_info.csv','r');
        $row_i = 0;
        $data = $total = array();
        while ($file_data = fgetcsv($hl)) {
            ++$row_i;
            $name   = $file_data[0];
            $adress = $file_data[1];
            $phone  = $file_data[2];
      
            $data['name'] = $name;
            $data['adress'] = $adress;
            $data['phone'] = $phone;
            $total[]=$data;
           }
         
        fclose($hl);
        var_dump($total);

 

相关文章:

  • 2021-10-03
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-12-05
  • 2021-11-23
猜你喜欢
  • 2022-03-04
  • 2021-08-02
  • 2022-12-23
  • 2022-01-05
相关资源
相似解决方案