Exemple #1
0
 public function parse_csv($csv, $dir = NULL)
 {
     if (!is_null($dir)) {
         $this->picdir = $dir;
     }
     $products = array();
     $csvArr = csv::decode($csv);
     foreach ($csvArr as $lc => $l) {
         if ($this->is_empty($l)) {
             continue;
         }
         //表头
         if ($lc === 0) {
             continue;
         }
         $product = $this->set_product($l);
     }
     return array('errors' => $this->errors);
 }