function parse_csv($file, $options = null) {
$delimiter = empty($options['delimiter']) ? "," : $options['delimiter'];
$to_object = empty($options['to_object']) ? false : true;
$expr="/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/"; // added
$str = $file;
$lines = explode("\n", $str);
$field_names = explode($delimiter, array_shift($lines));
foreach ($lines as $line) {
// Skip the empty line
if (empty($line)) continue;
$fields = preg_split($expr,trim($line)); // added
$fields = preg_replace("/^\"(.*)\"$/","$1",$fields); //added
//$fields = explode($delimiter, $line);
$_res = $to_object ? new stdClass : array();
foreach ($field_names as $key => $f) {
if ($to_object) {
$_res->{$f} = $fields[$key];
} else {
$_res[$f] = $fields[$key];
}
}
$res[] = $_res;
}
return $res;
}
SELECT count(*) FROM ( SELECT COUNT(*) FROM www_dc9_cn group by dc9_uid ) AS dc9
<!--{loop $ti[stxxarray2] $index2 $xx2}-->
<input type="radio" name="shiti[da][$ti[stid]]" value="$index2"/>$xx2<br/>
<!--{/loop}-->
//http://www.dc9.cn
<!--{loop $ti[stxxarray2] $index2 $xx2}-->
<input type="radio" name="shiti[da][{$ti[stid]}]" value="$index2"/>$xx2<br/>
<!--{/loop}-->
//http://www.dc9.cn
" INSERT INTO cs (starttime,endtime) VALUES ( NOW() , DATE_ADD( NOW(), INTERVAL 120 MINUTE) ) "
if ($("#stgd:checked").length>0)
{
alert('http://www.dc9.cn');
}
if ($(":radio:checked").length>0)
{
alert('http://www.dc9.cn');
}
Array.prototype.push = function(value) {
this[this.length] = value;
return this.length;
}
if(typeof Array.prototype.push === 'undefined') {
Array.prototype.push = function(value) {
this[this.length] = value;
return this.length;
}
}
//http://www.dc9.cn