String help needed

From: Date: Thu, 24 Aug 2000 03:04:30 +0000
Subject: String help needed
Groups: php.general 
Request: Send a blank email to php-general+get-13289@lists.php.net to get a copy of this message
Does anyone have a routine already built that will give you the name of the current directory? Only the current directory is needed. I don't need the directory before it or the file that is being called. IE.....If the path is /refer/yahoo/ , I only need the yahoo. I thought about using the various string commands, but I must be too tired to figure it out. This is what I have. $myPath = $PHP_SELF; echo $myPath . " - Path<br>"; echo strlen($myPath) . " - String Length<br>"; $first = strpos($myPath, ".htm"); $last = substr($myPath, 7, 1); echo $first . " - String Pos<br>"; echo $last . " - Start of Directory name<br>"; echo strpos($myPath, "index.htm"); I have looked over the manual, but like I said, I must be too tired to figure it out. Anyone? TIA CDitty

« previous php.general (#13289) next »