Dynamically loading CSS files based on URL or URI in PHP
Most of questions you are asking are not fit for this site and your code does not work as intended but this is an interesting case to review
The grave mistake
Adding anything to your code just in case there would be some imaginary &quot;error of some kind&quot; is the worst thing a programmer could do ever. You effectively ruined your code with adding that || $_SERVER['PHP_URL_PATH'] stuff:

there is no such thing $_SERVER['PHP_URL_PATH'] for starter: such a variable just doesn't exist
of course ['PHP_URL_PATH'] without the $_SERVER part makes no sense
neither the whole condition returns anything sensible due to PHP syntax rules you are yet to learn.

Yet this code works somehow, albeit not the way you expect.
The operator precedence
The way this code executes is a very interesting matter, once I wrote an article that explains it in detail, Operator precedence or how does 'or die()' work. Given you only started learning it could be too complex for you for the moment to wrap your head around, but in time you will find it very interesting to read.
$_SERVER['PHP_SELF'] || $_SERVER['PHP_URL_PATH']  === &quot;/mainHubV8.1.php&quot; doesn't mean &quot;if either PHP_SELF or PHP_URL_PATH equal to /mainHubV8.1.php&quot;. It means &quot;if PHP_SELF contains any value OR PHP_URL_PATH is equal to /mainHubV8.1.php&quot;.
In short, an expression $_SERVER['PHP_SELF'] || $_SERVER['PHP_URL_PATH']  === &quot;/mainHubV8.1.php&quot; evaluates to true when $_SERVER['PHP_SELF'] contains any value. Which means always.
Given PHP already has it's answer, it ceases to execute the further condition. This is why you can write either $_SERVER['PHP_URL_PATH'] or ['PHP_URL_PATH'] or don't even get a notice for the non-existent array index - this code is just never executed.
As a result, this code will always output just &quot;Loading Styles for MainHubV8.1.php&quot; no matter which page it is called on.
The right way
To elaborate on the Neoan's answer, given you have 3 styles to load, here is the proposed array structure
$stylesheets = [
    '/mainHubV8.1.php' =&gt; [
        'style1.css',
        'style2.css',
        'style3.css',
    ],
    '/advSearchV8.1.php' =&gt; [
        'style4.css',
        'style5.css',
        'style6.css',
    ],
    // and so on
];

given this structure, you will be able to get the correct styles right from $_SERVER['PHP_SELF']:
foreach($stylesheets[$_SERVER['PHP_SELF']] as $file) {
    echo &quot;&lt;link rel='stylesheet' type='text/css' href='$file'&gt;\n&quot;;
}