Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

getcwd() function

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

getcwd() function

Postby FriedSmurf » Wed Sep 26, 2012 8:25 am

Hi mates!
I´m using getcwd() to get the directory of my current PHP file.

I know that if i want to move up to another directory (images for example) i can code :
Code: Select all
$path=getcwd().DIRECTORY_SEPARATOR.'images';


But what should i write if i want to go down one directory? :oops:

Hope you can help me.
Thanks in advance,
FriedSmurf
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Sep 26, 2012 8:17 am

Re: getcwd() function

Postby egami » Wed Sep 26, 2012 1:35 pm

the syntax would be.


cd ..

so, $path = chdir("..");
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: getcwd() function

Postby FriedSmurf » Wed Sep 26, 2012 8:29 pm

thanks a lote m8! 8)
FriedSmurf
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Sep 26, 2012 8:17 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron