<comp.lang.ph p , Kim André Akerø , kimandre@NOSPAM betadome.com>
<3theu2Ft4048U1 @individual.net >
<10 Nov 2005 17:39:14 GMT>
[color=blue][color=green]
> > For use in a install.php
> >
> > What would be the best way to do it .[/color]
>
> Probably with getcwd().
> http://php.net/getcwd
> [/color]
<comp.lang.ph p , Krustov , krusty@krustov. co.uk.INVALID>
<MPG.1ddd991e1a 81c0c498a68a@no-cancel.newsread er.com>
<Thu, 10 Nov 2005 17:52:02 -0000>
[color=blue][color=green][color=darkred]
> > > For use in a install.php
> > >
> > > What would be the best way to do it .[/color]
> >
> > Probably with getcwd().
> > http://php.net/getcwd
> >[/color]
>
> Sounds good to me - thank you .
>[/color]
As I only need/want the last folder name and as i'm still a bit of a php
newbie is there any better way of doing it than the following .
(havent tried it on the webspace yet but assume it works just as well)
<?php
$junk=getcwd();
print $junk;
$pass="0"; $long=0;
$tv=strlen($jun k); $dvd=$tv-1;
while ($pass=="0")
{
$vhs=substr($ju nk,$dvd,1);
if ($vhs==chr(47)) {$pass=1;}
if ($vhs==chr(92)) {$pass=1;}
$long=$long+1; $dvd=$dvd-1;
}
Krustov wrote:[color=blue]
> As I only need/want the last folder name and as i'm still a bit of a
> php newbie is there any better way of doing it than the following .
>[/color]
<comp.lang.ph p , Janwillem Borleffs , jw@jwscripts.co m>
<4373b613$0$675 71$dbd4d001@new s.euronet.nl>
<Thu, 10 Nov 2005 22:05:28 +0100>
[color=blue][color=green]
> > As I only need/want the last folder name and as i'm still a bit of a
> > php newbie is there any better way of doing it than the following .
> >[/color]
>
> print basename(getcwd ());
>[/color]
Typical and my own fault for not being clear in the OP .
Comment