This class is for unit conversion (trying to pull in file corresponding to conversion). Here is my php function...
Code:
function parse($type, $value, $input, $output) {
$file = trim($type) . ".class.php";
if (file_exists($file)) {
require_once($file);
$className = "convert" . ucwords($type);
$CLS = new $className;
$value = "PHP is gay";
}
else {
$value = $file;
}
return $value;
}
I am calling the function like so...
Code:
parse("alternative", "100", "meters/square second", "feet/square second")
So basically I am calling the file alternative.class.php and the weird thing is if I change the file_exists() function to the require_once() function the if statement works. I am really lost.
Bookmarks