$page = $_SERVER['REQUEST_URI'];
if($page == 'index.php?page=1')
{
echo '<body class="body1">';
}
if($page == 'index.php?page=2')
{
echo '<body class="body2">';
}
Как будет правильнее?
$page = $_SERVER['REQUEST_URI'];
if($page == 'index.php?page=1')
{
echo '<body class="body1">';
}
if($page == 'index.php?page=2')
{
echo '<body class="body2">';
}
class="lala<?php echo (int)$_GET['page']; ?>"
$page=(int)$_GET['page'];
if($page ===1)
{
$bg = 'body1';
}
if($page===2)
{
$bg = 'body2';
}
<body class="<?=$bg?>">