$replace = [
'{name}' => $settings['title'],
'{lastBuy}' => $lastBuy,
'{history}' => $history,
'{privilege}' => $privilege,
'{nowDate}' => date('o'),
'{music}' => '<embed src="/new.mp3" volume="-300" hidden="true" autostart="true">',
'{admin}' => $settings['AdminVkId']
];
{music} = '<embed src="/new.mp3" volume="-300" hidden="true" autostart="true">',
'{music}' => $settings['music'] ? '<embed src="/new.mp3" volume="-300" hidden="true" autostart="true">' : '',
$replace = array();
if ($settings['music'])
{
$replace['{music}'] = '<embed src="/new.mp3" volume="-300" hidden="true" autostart="true">';
}
else
{
$replace['{music}'] = "";
}
....
$tmp = [
'name' => $settings['title'],
'lastBuy' => $lastBuy,
'history' => $history,
'privilege' => $privilege,
'nowDate' => date('o'),
'music' => '<embed src="/new.mp3" volume="-300" hidden="true" autostart="true">',
'admin' => $settings['AdminVkId']
];
$replace = array();
foreach($tmp as $key => $value)
{
if ($settings[$key])
{
$replace["{{$key}}"] = $value;
}
else
{
$replace["{{$key}}"] = "";
}
}