. require( "../../../config.php"); export(); function export() { global $CFG; $file = "import.php"; $h = fopen($file, 'w') or die("can't open file"); fwrite( $h, "level, $rec->opened, '$rec->data')\", false);\r\n"); if (++$i % 10 == 0) { fwrite( $h, "\r\n"); } } fwrite( $h, "\r\necho'Finished importing';"); fclose($h); }