31 Jan 2016

Using PHP include to navigate up a folder

On occassion I've needed to include a file that was outside the current the directory. To do so use the following:

<?php
include(dirname(__FILE__)."/../../blocks/mod_events.php");
?>

The include(dirname(_FILE_) returns the current path.