Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to go one folder back in __dir__ in php

// One level up
echo str_replace(realpath(dirname(__FILE__) . '/..'), '', realpath(dirname(__FILE__)));

// Two levels etc.
echo str_replace(realpath(dirname(__FILE__) . '/../..'), '', realpath(dirname(__FILE__)));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #folder #php
ADD COMMENT
Topic
Name
6+4 =