note 42459 added to function.substr-count
| From: | Garfield at rn2 dot php dot net | Date: | Mon, 17 May 2004 18:51:56 +0000 |
| Subject: | note 42459 added to function.substr-count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69730@lists.php.net to get a copy of this message | ||
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
?>
----
Manual Page -- http://www.php.net/manual/en/function.substr-count.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42459
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42459&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42459&report=yes
Search -- http://master.php.net/manage/user-notes.php