$_GET
是否可以在不指定名称的情况下获得第一个键?
我想做类似的事情,调用这个 php 文件,如:index.php?foo=something
或index.php?bar=something
// $_GET[dynamic] stays for something to get the key.. that can be foo or bar in this example
switch($_GET[dynamic]){
case 'foo':
switch(@$_GET['foo']){
//cases depending on $_GET['foo'] value
}
break;
case 'bar':
switch(@$_GET['bar']){
//cases depending on $_GET['bar'] value
}
break;
}