我要輸出一條消息, 每當鏈接包括與p2
開始,例如,在以下所有實例的任何參數:如何檢查url中是否存在參數?
example.com/?p2=hello
example.com/?p2foo=hello
example.com/?p2
example.com/?p2=
我試過了:
if (!empty($GET['p2'])) {
echo "a parameter that starts with p2 , is showing in your url address";
} else {
echo "not showing";
}
的[檢查查詢字符串(PHP)](可能的複製http://stackoverflow.com/questions/1599193/check-query-string-php ) – brnrd