note 57000 added to function.include

From: Date: Wed, 21 Sep 2005 13:06:28 +0000
Subject: note 57000 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-95528@lists.php.net to get a copy of this message
This is yet another way to include files relative to the current file. I find it easier if you have a lot of includes. <?php $prewd = getcwd(); // get the current working directory chdir(realpath(dirname(__FILE__))); // change working directory to the location of this file include('includedfile.php'); // include relative to this file chdir($prewd); // change back to previous working dir ?> ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57000 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57000&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57000&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57000&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57000&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57000&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57000&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57000&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57000&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95528) next »