For example,
This is index.php
require_once(\'header.php\'); ?>
Can header.php know it was included by index.php?
$_SERVER['PHP_SELF'] should still point to file originally accessed, or you could set a variable before the require, eg:
$_SERVER['PHP_SELF']
$section = 'home'; require_once('header.php');
...
if ($section == 'home') { ... }