?\n?\$~", '', $return); if (substr_count($return, "") <= 0 && !$match[5]) { $return .= "\n$return"; } return $return; } $file = file_get_contents("index.php"); $file = preg_replace_callback('~(<\\?php\\s*)?(include|require)(_once)? "([^"]*)";(\\s*\\?>)?~', 'put_file', $file); //! remove spaces and comments file_put_contents("phpMinAdmin.php", $file); echo "phpMinAdmin.php created.\n";