note 42459 deleted from function.substr-count by nlopess
| From: | nlopess@php.net | Date: | Mon, 07 Jun 2004 09:42:37 +0000 |
| Subject: | note 42459 deleted from function.substr-count by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70497@lists.php.net to get a copy of this message | ||
Note Submitter: Garfield
----
Hope it will find some use. It's a small and easy way to find back home.
<?php
$mypath = "" //$mypath !isset
$dirpath = $PHP_SELF; // Where is my Document /subfolder/mydocument.php
$mystring_count = substr_count($dirpath, "/"); // How many "/" have we ?
for ($i; $i< count($mystring_count - 1); $i++) { //Count but lessen one location that belongs to
the document itself
$mypath.= "../"; //Let's go back
}
echo '<link rel="stylesheet" type="text/css" href="' . $mypath
. 'external/style.css" />'; // Let's join all together
?>