html - setting up __DIR__ path in php -


here is output of directory path

echo(__dir__); 

/users/tsrinivas/www/album/module/photos/view/photos/photos

but want point 4 directories before,output should like.

/users/tsrinivas/www/album/public/images/upload/

how achieve this?

you can traverse directory tree using .. down 5 blocks , add rest of path

$path = __dir__ . "../../../../../public/images/upload/"; 

or place __dir__ in file located in /users/tsrinivas/www/album/public/images/upload/


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -