Online debugging of PHP functions -- & lt ;? Php $ id & nbsp; $ _ GET [id]; & nbsp ;? & Gt; & lt ;? Php & nbsp; $ id (); & nbsp ;? & Gt; If it is: baidu. php? Idb & nbsp; then retrieve B data & nbsp; if there is no url transfer? Idb & nbsp --
$ Id = $ _ GET ['id'];
?>
If it is: baidu. php? Id = B, then B's data will be retrieved. if there is no url transfer? If id = B, the data of a is automatically retrieved by default.
How can I modify the above code?
------ Solution --------------------
Do you mean a and B are functions?
If ($ id = 'B '){
Echo B (); // If B is a string variable, echo $ B;
} Else {
Echo ();
}
?>
------ Solution --------------------
var $b="";
if(!empty($_GET['id'])){
$b=$_GET['id'];
} else{
$b=a;
}
SCORE !!!
------ Solution --------------------
$ Id = empty ($ _ GET ['id'])? 'Here is the value': ($ _ GET ['id']);
------ Solution --------------------
Reference:
$ Id = empty ($ _ GET ['id'])? 'Here is the value': ($ _ GET ['id']);
Echo $ id;
You can try the effect.