<?
$handle = fopen("item(kor).txt", "r");
$group=-1;
echo"
drop table allitems <br>
CREATE TABLE [allitems] ( <br>
[type] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , <br>
[id] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , <br>
[name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , <br>
[x] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , <br>
[y] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL <br>
) ON [PRIMARY] <br>
GO <br>
<br>
DELETE FROM allitems <br>";
while (!feof($handle)) {
$userinfo = fscanf($handle, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%[a-zA-Z0-9\" ]\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n");
if ($userinfo) {
list ($index,$slot,$skill,$x,$y,$sirial,$opt,$drop,$name,$level,$DamMin,$DamMax,$Speed,$Dur,$MagDur,$MagPwr,$ReqLvl,$str,$agi,$vit,$Com,$type,$dw,$bk,$elf,$mg,$dl,$sum) = $userinfo;
$index = preg_replace('/[^0-9]/', '', $index);
if ($name) {
$name = preg_replace('/[^a-zA-Z0-9\ \-]/', '', $name);
if($name!="Name")echo "INSERT INTO allitems VALUES ('$group','$index','$name','$x','$y')<Br>";
if($name=="Name")++$group;
}}}
fclose($handle);
?>