there are function a and function b in test.php,which will be called by the parameter of “act” in $_GET,and it have a default value if there is no value of “act”
<?php
if(isset($_GET['act'])&&$_GET['act']){
$act=$_GET['act'];
}else{
$act='a';
}
function a(){
echo('this is a');
}
function b(){
echo('this is b');
}
$act();
?>
if i run the code below,it will call function a and function b in test.php,
<?php
include ("test.php");
b();
?>
how can it just call function b only? i don’t want to change the default value of “act”,because it will be used by other system
thanks
you may define some variable/constant inside the included file, and when it exists, don’t call
$act()…….