$myfile = fopen("../news/$latin.php", "w") or die("Unable to open file!");
$txt = "\x3C\x3Fphp
$db = new PDO(dsn:\"mysql:host=localhost;dbname=BorkiFestival_site\", username:\"root\", password:\"root\");
$info = array();
$str = $db->quote(pathinfo(__FILE__, PATHINFO_FILENAME)); // необходима экранизация? делаем экранизацию!
if($query = $db->query(\"SELECT * FROM `news_cards` WHERE name_src LIKE ' {\$str}'\")){
$info = $query->fetchAll(fetch_style: PDO::FETCH_ASSOC);
} else {
print_r($db->ErrorInfo());
}
foreach($info as $data):\x3F\x3E
";
fwrite($myfile, $txt);
fclose($myfile);