note 14046 added to function.require-once.php
| From: | glenpa at sympatico dot ca | Date: | Sat, 14 Jul 2001 19:15:27 +0000 |
| Subject: | note 14046 added to function.require-once.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15379@lists.php.net to get a copy of this message | ||
since my pages are very long and they use the same layout, i separated parts of the pages which
repat themselves in every page and required them and require_once'd the function i use in them
on the page so the page looks like this
::
--------------------
<?php
require_once("./inc/funct.in.php");
...
start_html();
require("./header.inc.php");
require("./menu.inc.php");
?>
blah!
<?php
require("./footer.inc.php");
end_html();
?>
--------------------
::
ad the problem is that in menu.inc.php, i use a function named break() declared and defined in
funct.inc.php. i have many ohter functions un funct.inc.php that work very well in menu.inc.php but
for break(), it wont work. this is the error given:
::
--------------------
Parse error: parse error, expecting `T_STRING' in ./inc/funct.inc.php on line 2
--------------------
::
and here is the beginning of funct.inc.php:
::
--------------------
<?php
function break() {
echo "<br>\n";
}
function make_link($link,$name) {
echo "<a href='".$link."'>".$name."</a>";
}
...
?>
--------------------
::
make_link is a function i also use in menu.inc.php and it WORKS!!!
this sounds weird!!
http://www.php.net/manual/en/function.require-once.php