Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设您在此页面上:profile.php?user=1&wicked=3
profile.php?user=1&wicked=3
得到一个像这样的数组:
Array ( [user] => 1 [wicked] => 3 )
如何简单地获取数组的第一个或第二个值?所以如果我想要第二个,我会得到:wicked=3?是带有foreach循环的东西吗?
wicked=3
如果我猜对了,您想使用数字索引数组。
$new_ar = array_values($_GET) ; //["user"=>"1", "wicked"=>"3"] ; echo $new_ar[1] ; // echoes 2nd value - "3"