need help in .string manuplation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

need help in .string manuplation

Post by itsmani1 »

Code: Select all

$temp =  $_SERVER['PATH_TRANSLATED'];
	echo stripslashes($temp);
I tried the above code and found following results.
-------------------------------------
c:\apache\htdocs\root\str.php
c:\apache\htdocs\abc\str.php
c:\apache\htdocs\test\str.php
c:\apache\htdocs\str.php
--------------------------------------
now i wanted to check wheather \root\, \abc\, \test\ exists or not ?
I mean to say is :
if the sub folder exists or not and if it exists whats its name?

help me plz.

Tahnx.
Mannan.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

are you asking about finding what directories are under a know one?
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

yeah exectly i wanted to know the dir.

thanx.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Code: Select all

$_SERVER['REQUEST_URI']
in this way i can fine some thing like this.

/abc/root/index.htm
/abc/root1/index.html
/root/index.html

but how can i fetch root form it.
i want to fetch root, root1 etc.

.......
Mannan.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

REQUEST_URI doesn't tell you what folder to look under.
PATH_TRANSLATED and DOCUMENT_ROOT can tell you, but you have to pull the directory out using dirname()
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

can you plz. tell me how i can get current directory sing
$_SERVER['PATH_TRANSLATED'];


thanx.
Mannan.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I did.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

feyd wrote:I did.
can you pzl. help me out man?

---------------
Mannan.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

read. the. post.
feyd wrote:REQUEST_URI doesn't tell you what folder to look under.
PATH_TRANSLATED and DOCUMENT_ROOT can tell you, but you have to pull the directory out using dirname()
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Thanx. feyd .....
its working......

Thanx again ....
Mannan.
Post Reply