I have a functions.php page with some functions, it is required in the default.php page which is required by all my other pages (index.php) at the first line.
index.php (1st line after <?php
require("includes/default.php");
default.php
<?php
//mysql
require("templates.php");
require("functions.php");
?>
functions.php
<?php
function rating_format($num) {
if ($num > 0) {
return "+" . $num;
}
elseif ($num < 0) {
return "-" . $num;
}
else {
return $num;
}
}
function thumbnail_url($value) {
if ($value == "") {
return "no_favicon.png";
}
else {
return $value;
}
}
?>
I use both functions defined in functions.php in index.php. However, only the second function seems to be defined. Whenever trying to use the first function, it spits out an function undefined error.
I've rearranged the code several times and don't know what is wrong with it. The function is defined before I even use it.
Any help is appreciated.