Say I have two files, this.php and that.php. Notice that each file declares function calcX(), only each returns a different value;
-- this.php --
function calcX(){
return 2 + 2;
}
-- that.php --
function calcX(){
return 7 + 7;
}
I'm running into the situation where the equivalent of this is happening
<?php
function B(this/that){
if(this){
include("this.php");
}elseif(that){
include("that.php");
}
calcX();
}
B(this);
B(that);
?>
First call to B(this) includes this.php and calls calcX() just fine. The secong call to B(that) includes that.php but then gives an error that calcX() has already been declared. My guess is that it is from the first time I called B(this). But since the include is within a function would the first include be out of the scope of the second call to the function? How can I get around this? Any un-includes?