时间:2021-07-01 10:21:17 帮助过:4人阅读
switch (array_key_exists('dopost',$_GET()))
{
case 'dopost':
# code...
break;
case 'edit':
break;
//后面还有好几个
default:
# code...
break;
}
foreach($_GET as $k=>$v) {
switch ($k) {
case 'dopost':
# code...
break;
case 'edit':
break;
//后面还有好几个
default:
# code...
break;
}
}
//url形式:http://localhost?k=dopost
//url形式:http://localhost?k=edit
if(isset($_GET['k'])){
switch ($_GET['k'])
{
case 'dopost':
# code...
break;
case 'edit':
break;
//后面还有好几个
default:
# code...
break;
}
}