使用$_GET["arg"]获取参数时总提示Notice:Undefined index,url检查过没有问题,确实带有参数,使用var_dump($_GET["arg"])也可输出,但是直接赋值$a=$_GET["arg"]就报错。使用@也无效。请教各位怎样能解决并正确取值?
php7.2
<?php
//php
//index.php 浏览器访问 index.php?arg=val
var_dump($_GET['arg']);
$a = $_GET['arg'];
var_dump($a);
?>追问
//php
//index.php 浏览器访问 index.php?arg=val
var_dump($_GET['arg']);
$a = $_GET['arg'];
var_dump($a);
?>追问
温馨提示:答案为网友推荐,仅供参考