Как добавить оператор if в тег в php
у меня есть код для смены темы..
$css = $_SESSION['type'] ? $_SESSION['css'] : 2;
if(sizeof($_POST) > 0) {
$_SESSION['css'] = $_POST['css'];
}
echo '<form action="/" method="POST">';
$open = opendir('style');
while($file = readdir($open))
{
if(is_file('style/'.$file) AND substr($file, -3) == 'css') {
echo '<input type="radio" name="css" value="'.str_replace('.css', NULL, $file).''.if(str_replace('.css', NULL, $file) == $css).' checked="checked"/>
'.str_replace('.css', NULL, $file).'</div>';
}
}
closedir($open);
echo '<InpuT type="submit" value="Пременить"/>
</form>';
Ошибка тут
'.if(str_replace('.css', NULL, $file) == $css).'
Как можно добавить оператор if внутри тег input? Помогите с кодом, заранее спасибо.