Re: neubie seeking answers
| From: | Stuart Dallas | Date: | Fri, 01 Apr 2011 08:28:16 +0000 |
| Subject: | Re: neubie seeking answers | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312186@lists.php.net to get a copy of this message | ||
On Friday, 1 April 2011 at 03:31, Kirk Bailey wrote:
PERFECT SIMPLE SOLUTION. THANK YOU!
As Richard noted there is a constant called __DIR__ which is equivalent to dirname(__FILE__) so
basename(__DIR__) will give you what you want and saves a few cycles.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
> On 3/31/2011 12:34 PM, Stuart Dallas wrote:
> > On Thursday, 31 March 2011 at 17:24, Kirk Bailey wrote:
> > I need to extract the name of the subdirectory a page lives in to
> > > use in the title for that page. This will be returned as a string to
> > > echo to the output stream. Now how the heck do I do that?!?
> > $dir = basename(dirname(__FILE__));
> >
> > -Stuart
>
> --
> end
>
> Very Truly yours,
> - Kirk Bailey,
> Largo Florida
>
> kniht
> +-----+
> | BOX |
> +-----+
> think
>