コード例 #1
0
function explodeOnWhitespace($str)
{
    return explodeOn(' ', $str);
}
コード例 #2
0
 /**
  * If argument is a string, it explodes on comma
  * using \explodeOn because of strings that look like `",", "b"` (quoted commas)
  * @param   mixed   $param
  * @return  array
  */
 public static function csvToArray($param)
 {
     return is_string($param) ? array_filter(array_map('trim', \explodeOn(',', $param))) : $param;
 }
コード例 #3
0
ファイル: class.CSVParser.php プロジェクト: hshoghi/cms
 private function _getRemoteCSV()
 {
     // only use " " as escaped
     $conf = array('ignore' => array("'", "("));
     $file = file_get_contents($this->path);
     $file = explodeOn("\n", $file, $conf);
     $csv = array();
     $i = 0;
     foreach ($file as $row) {
         // if headers, skip the first row
         if ($i && $this->has_headers) {
             $i++;
             continue;
         }
         $csv[] = $this->_mapRow(explodeOn($this->delimiter, $row, $conf));
     }
     return array_filter($csv);
 }