note 52913 modified in function.include by danbrown

From: Date: Mon, 18 May 2009 01:04:46 +0000
Subject: note 52913 modified in function.include by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155479@lists.php.net to get a copy of this message
Thought you can figure it out by reading the doc, this hint might save you some time. If you override include_path, be sure to include the current directory ( . ) in the path list, otherwise include("includes/a.php") will not search in the current script directory. e.g : <?php if(file_exists("includes/a.php")) include("includes/a.php") ?> The first line will test to true, however include will not find the file, and you'll get a "failed to open stream" error --was-- Thought you can figure it out by reading the doc, this hint might save you some time. If you override include_path, be sure to include the current directory ( . ) in the path list, otherwise include("includes/a.php") will not search in the current script directory. e.g : if(file_exists("includes/a.php")) include("includes/a.php") The first line will test to true, however include will not find the file, and you'll get a "failed to open stream" error http://php.net/manual/en/function.include.php

« previous php.notes (#155479) next »