I can see one reason for wanting to have dynamic and relative path generation for href links, and that is if you run your project on multiple domains or sites that have different paths. (For example, your project is available on http://myproject.example.org/ and also on http://example.org/myprojecttest/). If this is not the case, I would suggest directly specifying your css includes relative to the root folder:
<link href="/css/style.css" />
If this does apply to you, try this:
In every top-level document that requires header.php, add a $ROOT variable that indicates the top-level document's location compared to the root. e.g.:
$ROOT = './';
or
$ROOT = '../';
or
$ROOT = '../../';
Now, in your header.php file, you can use:
<link href="<?php echo $ROOT; ?>css/style.css" />
This allows you to make a header.php file that will work for any page at any relative path.
Full Example
Included File (/path/header.php)
<html><body>
<head>
<link href="<?php echo $ROOT; ?>css/style.css" />
[...]
File 1 (/path/index.php):
<?php
$ROOT = './';
include 'header.php';
?>
File 1 (/path/admin/index.php):
<?php
$ROOT = '../';
include '../header.php';
?>
File 3 (/path/admin/test/magic.php):
<?php
$ROOT = '../../';
include '../../header.php';
?>