Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

getting base directory
I want a function that gives me the base directory of a script.

So when given the script file '/var/www/test.org/html/test/index.php' from
$_SERVER['SCRIPT_FILENAME'] it returns '/var/www/test.org/html/test/'.

I am wondering the neatest way to do this ?

I cannot find a reverse string search function.

Many thanks in advance,

Aaron



Report this thread to moderator Post Follow-up to this message
Old Post
Aaron Gray
04-03-08 12:20 AM


Re: getting base directory
"Aaron Gray" <ang.usenet@gmail.com> wrote in message
news:65horiF2g0v0aU1@mid.individual.net...
> I want a function that gives me the base directory of a script.
>
> So when given the script file '/var/www/test.org/html/test/index.php' from
> $_SERVER['SCRIPT_FILENAME'] it returns '/var/www/test.org/html/test/'.
>
> I am wondering the neatest way to do this ?
>
> I cannot find a reverse string search function.
>
> Many thanks in advance,
>
> Aaron
>
>

basename


Report this thread to moderator Post Follow-up to this message
Old Post
Steve Foley
04-03-08 12:20 AM


Re: getting base directory
"Steve Foley" <steve.foley@att.DELETE.net> wrote in message
news:d5OIj.14899$oE1.7400@trndny09...
> "Aaron Gray" <ang.usenet@gmail.com> wrote in message
> news:65horiF2g0v0aU1@mid.individual.net... 
>
> basename

That was quick :)

Thanks,

Aaron



Report this thread to moderator Post Follow-up to this message
Old Post
Aaron Gray
04-03-08 12:20 AM


Re: getting base directory
"Steve Foley" <steve.foley@att.DELETE.net> wrote in message
news:d5OIj.14899$oE1.7400@trndny09...
> "Aaron Gray" <ang.usenet@gmail.com> wrote in message
> news:65horiF2g0v0aU1@mid.individual.net... 
>
> basename

You mean dirname not basename !:)

Aaron



Report this thread to moderator Post Follow-up to this message
Old Post
Aaron Gray
04-03-08 12:20 AM


Re: getting base directory
<comp.lang.php>
<Aaron Gray>
<Wed, 2 Apr 2008 17:04:44 +0100>
<65hpe8F2fl881U1@mid.individual.net>
 
>
> You mean dirname not basename !:)
>

 $batman=pathinfo($doc,PATHINFO_DIRNAME);


Havent actually tried it myself - its just a snippet of code i have .


--
www.krustov.co.uk

Report this thread to moderator Post Follow-up to this message
Old Post
Krustov
04-03-08 12:20 AM


Re: getting base directory
"Krustov" <me@privacy.net> wrote in message
news:MPG.225dc386ad8c913b98b370@news.newsreader.com...
> <comp.lang.php>
> <Aaron Gray>
> <Wed, 2 Apr 2008 17:04:44 +0100>
> <65hpe8F2fl881U1@mid.individual.net>
> 
>
>  $batman=pathinfo($doc,PATHINFO_DIRNAME);

>
> Havent actually tried it myself - its just a snippet of code i have .

It works I have used it in my utils.

Aaron



Report this thread to moderator Post Follow-up to this message
Old Post
Aaron Gray
04-03-08 12:20 AM


Re: getting base directory
"Aaron Gray" <ang.usenet@gmail.com> wrote in message
news:65hpe8F2fl881U1@mid.individual.net...
>
> You mean dirname not basename !:)
>
> Aaron

Yup.


Report this thread to moderator Post Follow-up to this message
Old Post
Steve Foley
04-03-08 12:20 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:07 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.