note 41904 added to function.include

From: Date: Sun, 25 Apr 2004 17:59:48 +0000
Subject: note 41904 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-68794@lists.php.net to get a copy of this message
Including one file through another may cause confusion. Include works as if you copy all code from the new file and paste it in the first. NOTE: All paths in files that are included must be relative to the file which calls them. i.e.: 3 files: /main.php ; /dir/foo.php ; /dir/bar.php main.php : <? print('Executing /main.php<BR>'); include('foo/one.php'); ?> foo.php : <? print('Executing foo/one.php'); include('bar.php'); // <-- Will not work. include('dir/bar.php'); // <-- Will work. ?> Cool eh? ~[D] ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41904 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41904&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41904&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68794) next »