Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

parent directory in php

I Hope this will help you.

echo getcwd().'<br>'; // getcwd() will return current working directory
echo dirname(getcwd(),1).'<br>';
echo dirname(getcwd(),2).'<br>';
echo dirname(getcwd(),3).'<br>';
Output :

C:wamp64wwwpublic_htmlstep
C:wamp64wwwpublic_html
C:wamp64www
C:wamp64
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #parent #directory #php
ADD COMMENT
Topic
Name
9+1 =