<?php
$dirName = 'test';
$fileName = 'test.xml';
$filesInDir = scandir(__DIR__);
if (!in_array($dirName, $filesInDir)){
$path = __DIR__ . '/' . $dirName;
mkdir($path);
$filesInPath = scandir($path);
if (!in_array($fileName, $filesInPath)){
$text = "Any text";
$fp = fopen($path . '/' . $fileName, "w");
fwrite($fp, $text);
fclose($fp);
}
}
?>