note 120303 deleted from function.include by peehaa
| From: | peehaa@php.net | Date: | Fri, 09 Dec 2016 22:56:41 +0000 |
| Subject: | note 120303 deleted from function.include by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208402@lists.php.net to get a copy of this message | ||
Note Submitter: jk at buero-ix dot de
----
sometimes one has to run the same script both on the shell and on a server, so it is necessary to
know, where the included file is in relation to the working directory. a simple workaround can help:
<?php
$dir_work = getcwd();
$dir_file = "";
if ($dir != "directory on the server") {
$dir_file = "directory in relation to php.exe"; // for shell
}
include ($dir_file . $file);