note 27075 added to function.include

From: Date: Thu, 21 Nov 2002 21:54:19 +0000
Subject: note 27075 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-39836@lists.php.net to get a copy of this message
I used this function to include a file and check if it exists. This function doesn't actually use the include() function. function file_include($file,$errmsg) { if (!file_exists($file)) { die($errmsg); } $fp=fopen($file,"r"); $includedtext=fread($fp,filesize($file)); // Other things such as strstr() and str_replace() could be here. print $includedtext; } I am not totally sure if this is correct, though. -- http://www.php.net/manual/en/function.include.php http://master.php.net/manage/user-notes.php?action=edit+27075 http://master.php.net/manage/user-notes.php?action=delete+27075 http://master.php.net/manage/user-notes.php?action=reject+27075

« previous php.notes (#39836) next »