note 27716 deleted from function.file-get-contents by sniper
| From: | sniper@php.net | Date: | Fri, 21 Feb 2003 04:42:43 +0000 |
| Subject: | note 27716 deleted from function.file-get-contents by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-44290@lists.php.net to get a copy of this message | ||
if your coding a script and you want to use the most efficient method available, a function like
this may help:
function template($templatename) {
if (!file_exists("./$templatename")) {
echo "Template <b>$templatename</b> does not exsist.";
exit;
}
if(function_exists('file_get_contents')) {
$tpl = file_get_contents($templatename);
}
else {
$tpl=join("\n", file("./$templatename"));
}
return $tpl;
}