I am trying to set the ID of the <body>
tag to be the name of the current page...
<body id="<?= basename($_SERVER['PHP_SELF'])?>">
Why is this returning:
<body id="wildlife.php">
?
I want just the word "wildlife."
I am trying to set the ID of the <body>
tag to be the name of the current page...
<body id="<?= basename($_SERVER['PHP_SELF'])?>">
Why is this returning:
<body id="wildlife.php">
?
I want just the word "wildlife."
I think you need to add the extension suffix to strip off, Try this
<body id="<?= basename($_SERVER['PHP_SELF'],'.php')?>">