$value\n"; if ($key == "plane") { $realPlane[$key] = $value; $realBrush[] = $realPlane; } } } $realBrushes[] = $realBrush; //if ($i==3) // break; } $map = ""; $map .= "iwmap 4\n"; $map .= "{\n"; $map .= "\t\"classname\" \"worldspawn\"\n"; foreach ($realBrushes as $brush) { $map .= "\t{\n"; foreach ($brush as $planes) $map .= "\t\t" . $planes["plane"] . " case1024 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0 \n"; $map .= "\t}\n"; } $map .= "}\n"; //echo $map; $file = fopen("new.map", "w"); fwrite($file, $map); fclose($file); ?>