Changeset 9310 for trunk/MagicSoft/Mars/datacenter/db/tabs.php
- Timestamp:
- 02/10/09 14:33:52 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/tabs.php
r9248 r9310 58 58 ?> 59 59 <? 60 // read the file into an array 61 $lines = file($path.$csvname[$type].".csv"); 62 63 // some replacement for the printf 64 $search = array ("%", "\n", "\\" ); 65 $replace = array ("%%", "", "\\\\" ); 66 67 for ($i=0; $i<sizeof($lines); $i++) 60 61 $csvfile=$path.$csvname[$type].".csv"; 62 if (file_exists($csvfile)) 68 63 { 69 //$arr = get_csv($lines[$i], "\t\n"); 70 $tok = strtok($lines[$i], "\t\n"); 71 $j=0; 72 while ($tok!==false) 73 { 74 $arr[$i][$j++] = str_replace($search, $replace, $tok); 75 $tok = strtok("\t"); 76 } 77 } 64 // read the file into an array 65 $lines = file($csvfile); 66 67 // some replacement for the printf 68 $search = array ("%", "\n", "\\" ); 69 $replace = array ("%%", "", "\\\\" ); 70 71 for ($i=0; $i<sizeof($lines); $i++) 72 { 73 //$arr = get_csv($lines[$i], "\t\n"); 74 $tok = strtok($lines[$i], "\t\n"); 75 $j=0; 76 while ($tok!==false) 77 { 78 $arr[$i][$j++] = str_replace($search, $replace, $tok); 79 $tok = strtok("\t"); 80 } 81 } 82 } 78 83 79 84 // fclose($file);
Note:
See TracChangeset
for help on using the changeset viewer.