To back up to the previous directory you use two dots, as in '../some/path'. You can actually add those dots in the middle of the path to, as in 'go/to/oops_wrong/../right/file'
So you could do
PHP Code:
$cacheDir = basname (dirname(__FILE__)) . '../cache/';
// Though I suspect this would be enough(?) (Se below)
$cahceDir = '../cache/';
Although dirname() and basename() seems unnecessary. Because dirname() will remove the filename, leaving only the directory part, then basename() will remove the directory, leaving only the filename part. So, your $cacheDir would most likely hold just '/cache/'.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
|