note 72441 deleted from function.include by peehaa
| From: | peehaa@php.net | Date: | Fri, 09 Dec 2016 22:56:14 +0000 |
| Subject: | note 72441 deleted from function.include by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208401@lists.php.net to get a copy of this message | ||
Note Submitter: anonymous
----
When I'm dealing with a package that uses relative includes of its own, rather than modify all
of their includes, I found it was easier to change PHP's working directory before and after the
include, like so:
<?php
$wd_was = getcwd();
chdir("/path/to/included/app");
include("mainfile.php");
chdir($wd_was);
?>
This way neither my includes nor theirs are affected; they all work as expected.