29 return !feof($this->
file);
53 $testDataRow = trim(fgets($this->
file));
54 }
while (($testDataRow >
'') && ($testDataRow{0} ===
'#'));
57 list($testData) = explode(
'//',$testDataRow);
60 $dataSet = $this->
_getcsv($testData,
',',
"'");
61 foreach($dataSet as &$dataValue) {
69 private function _getcsv($input, $delimiter, $enclosure)
71 if (function_exists(
'str_getcsv')) {
72 return str_getcsv($input, $delimiter, $enclosure);
75 $temp = fopen(
'php://memory',
'rw');
76 fwrite($temp, $input);
78 $data = fgetcsv($temp, strlen($input), $delimiter, $enclosure);
81 if (
$data ===
false) {
90 $dataValue = trim($dataValue);
92 if (!is_numeric($dataValue)) {
93 if($dataValue ==
'') {
95 } elseif($dataValue ==
'""') {
97 } elseif(($dataValue[0] ==
'"') && ($dataValue[strlen($dataValue)-1] ==
'"')) {
98 $dataValue = substr($dataValue,1,-1);
99 } elseif(($dataValue[0] ==
'{') && ($dataValue[strlen($dataValue)-1] ==
'}')) {
100 $dataValue = explode(
';',substr($dataValue,1,-1));
101 foreach($dataValue as &$dataRow) {
102 if (strpos($dataRow,
'|') !== FALSE) {
103 $dataRow = explode(
'|',$dataRow);
104 foreach($dataRow as &$dataCell) {
114 switch (strtoupper($dataValue)) {
115 case 'NULL' : $dataValue = NULL;
break;
116 case 'TRUE' : $dataValue = TRUE;
break;
117 case 'FALSE' : $dataValue = FALSE;
break;
121 if (strpos($dataValue,
'.') !== FALSE) {
122 $dataValue = (float) $dataValue;
124 $dataValue = (int) $dataValue;
_parseDataValue($dataValue)
_getcsv($input, $delimiter, $enclosure)
Reload workbook from saved file
Create styles array
The data for the language used.