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 )
配列の最初または 2 番目の値を取得するにはどうすればよいですか? したがって、2番目が必要な場合は、次のようになりますwicked=3。foreach ループを使ったものですか?
wicked=3
私が正しければ、数値インデックス配列を使用したいと思います。
$new_ar = array_values($_GET) ; //["user"=>"1", "wicked"=>"3"] ; echo $new_ar[1] ; // echoes 2nd value - "3"