['regexp' => '/^[\da-zA-Z-. \/]+$/'], "flags" => FILTER_NULL_ON_FAILURE]); if ($lan) { $cmd = "$lanScanCmd $lan"; if (!file_exists($SCANSDIR)) mkdir($SCANSDIR); $filename = str_replace("/", "!", $lan); $path = "$SCANSDIR/$filename.xml"; if (!file_exists($path)) $cmd .= " | tee '$path'"; header('Content-type: text/xml'); system("$cmd", $retcode); } exit();