I am trying to exclude a css file from the home page of my site. We load the stylesheet with the header.php, so I am trying to not load it in the homepage.
this is my following code.
$hm == 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if ($hm == "home.php") {
echo "";
} else {
echo "yesstylesheet.css";
}
Use this snippet
$hm = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$hm1 = strrev($hm);
$hm2 = substr($hm1, strpos($hm1, "/") + 1);
$hm3 = "/".$hm2;
$hm4 = str_replace($hm3,"",$hm1);
$hm = strrev($hm4);
if ($hm == "home.php") {
echo "";
} else {
echo "yesstylesheet.css";
}
If do you mean home page - main page of your site, than you can try to use follow code
if ($_SERVER['REQUEST_URI']!="/")
{
echo "connect ccs here";
}