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.
在 garrys mod 上创建我的加载屏幕,并看到这个“无用”的编码,并打赌有一种方法可以大规模缩短它,但是我是一个 php nooby,想知道是否有一种方法可以使用数组或让它更容易/更短的东西?代码在这里
$array = array( "gm_flatgrass" => "Flatgrass", "cs_assault" => "CS Assault", "de_train" => "", ... ); $getmap = $_GET['mapname']; if(array_key_exists($getmap,$array)) { $map = $array[$getmap]; }