芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/public_html/cepali/lib/adodb/toexport.inc.php
FieldTypesArray(); reset($fieldTypes); $i = 0; $elements = array(); foreach ($fieldTypes as $o) { $v = ($o) ? $o->name : 'Field'.($i++); if ($escquote) $v = str_replace($quote,$escquotequote,$v); $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)))); $elements[] = $v; } $s .= implode($sep, $elements).$NEWLINE; } $hasNumIndex = isset($rs->fields[0]); $line = 0; $max = $rs->FieldCount(); while (!$rs->EOF) { $elements = array(); $i = 0; if ($hasNumIndex) { for ($j=0; $j < $max; $j++) { $v = $rs->fields[$j]; if (!is_object($v)) $v = trim($v); else $v = 'Object'; if ($escquote) $v = str_replace($quote,$escquotequote,$v); $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)))); if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote"; else $elements[] = $v; } } else { // ASSOCIATIVE ARRAY foreach($rs->fields as $v) { if ($escquote) $v = str_replace($quote,$escquotequote,trim($v)); $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)))); if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote"; else $elements[] = $v; } } $s .= implode($sep, $elements).$NEWLINE; $rs->MoveNext(); $line += 1; if ($fp && ($line % $BUFLINES) == 0) { if ($fp === true) echo $s; else fwrite($fp,$s); $s = ''; } } if ($fp) { if ($fp === true) echo $s; else fwrite($fp,$s); $s = ''; } return $s; }