我有問題如何在表中顯示的陣列它腓陣列讀取概率
MY代碼:
Array ([server_1] => Array ([_tutor_debug_level] => 0 [_tutor_examine_time] => 0.5 [_tutor_hint_interval_time] => 10.0 [_tutor_look_angle] => 10 [_tutor_look_distance] => 200 [_tutor_message_character_display_time_coefficient] => 0.07 [_tutor_message_minimum_display_time] => 1 [_tutor_message_repeats] => 5 [_tutor_view_distance] => 1000 [allow_spectators] => 1.0 [amx_client_languages] => 1 [amx_language] => en [amx_nextmap] => de_inferno [amx_ptb_version] => 1.8b3 [amx_timeleft] => 25:48 [amxmodx_version] => 1.8.2 [coop] => 0 [deathmatch] => 1 [decalfrequency] => 30 [dedicated] => d [dp_version] => 0.9.543 [edgefriction] => 2 [game_descr] => gametracker.rs [game_dir] => cstrike [gq_address] => 176.57.188.22 [gq_dedicated] => d [gq_gametype] => [gq_hostname] => ..:: LS Public Server ::.. #1 [gq_mapname] => de_nuke [gq_maxplayers] => 32 [gq_mod] => cstrike [gq_numplayers] => 30 [gq_online] => 1 [gq_password] => 0 [gq_port] => 27022 [gq_prot] => source [gq_type] => cs [hostage_debug] => 0 [hostage_stop] => 0 [hostname] => ..:: LS Public Server ::.. #1 [humans_join_team] => any [kgbbots] => 1 [ks_skore] => Ks Skore Zero by ScrappeR skype: elbasan.f v1.0 [map] => de_nuke [map_spawns] => T(20) CT(20) [max_players] => 32 [max_queries_sec] => 1 [max_queries_sec_global] => 1 [max_queries_window] => 1 [metamod_version] => 1.21-am [mp_allowmonsters] => 0 [mp_autokick] => 0 [mp_autokick_timeout] => -1 [mp_autoteambalance] => 1 [mp_buytime] => 0.75 [mp_c4timer] => 35 [mp_chattime] => 3 [mp_consistency] => 1 [mp_fadetoblack] => 0 [mp_flashlight] => 0 [mp_footsteps] => 1 [mp_forcecamera] => 2 [mp_forcechasecam] => 2 [mp_fragsleft] => 0 [mp_freezetime] => 2 [mp_friendlyfire] => 0 [mp_ghostfrequency] => 0.1 [mp_hostagepenalty] => 0 [mp_kickpercent] => 0.66 [mp_limitteams] => 0 [mp_logdetail] => 0 [mp_logfile] => 1 [mp_logmessages] => 1 [mp_mapvoteratio] => 0.66 [mp_maxrounds] => 0 [mp_mirrordamage] => 0 [mp_playerid] => 0 [mp_roundtime] => 2 [mp_slaylosers] => 1 [mp_startmoney] => 1400 [mp_timeleft] => 0 [mp_timelimit] => 40 [mp_tkpunish] => 0 [mp_windifference] => 1 [mp_winlimit] => 0 [num_bots] => 2 [num_players] => 30 [num_rules] => 29791 [os] => l [password] => 0 [pausable] => 0 [players] => Array ([0] => Array ([id] => 0 [name] => salkiiiii:) [score] => 29 [time] => 889.31640625 [gq_name] => salkiiiii:) [gq_score] => 29 [gq_ping] =>) [1] => Array ([id] => 0 [name] => SempTex [score] => 15 [time] => 1228.37890625 [gq_name] => SempTex [gq_score] => 15 [gq_ping] =>) [2] => Array ([id] => 0 [name] => ProfeSSionaL. [score] => 10 [time] => 1853.953125 [gq_name] => ProfeSSionaL. [gq_score] => 10 [gq_ping] =>) [3] => Array ([id] => 0 [name] => Tarzani [score] => 10 [time] => 1697.60546875 [gq_name] => Tarzani [gq_score] => 10 [gq_ping] =>) [4] => Array ([id] => 0 [name] => diamanti [score] => 9 [time] => 890.12109375 [gq_name] => diamanti [gq_score] => 9 [gq_ping] =>) [5] => Array ([id] => 0 [name] => Mally [score] => 8 [time] => 436.2421875 [gq_name] => Mally [gq_score] => 8 [gq_ping] =>) [6] => Array ([id] => 0 [name] => bARCELONA' [score] => 8 [time] => 1786.72265625 [gq_name] => bARCELONA' [gq_score] => 8 [gq_ping] =>) [7] => Array ([id] => 0 [name] => kInG [score] => 6 [time] => 451.72265625 [gq_name] => kInG [gq_score] => 6 [gq_ping] =>) [8] => Array ([id] => 0 [name] => Wassabi [score] => 5 [time] => 1243.27734375 [gq_name] => Wassabi [gq_score] => 5 [gq_ping] =>) [9] => Array ([id] => 0 [name] => GJYS [score] => 4 [time] => 7076.44921875 [gq_name] => GJYS [gq_score] => 4 [gq_ping] =>) [10] => Array ([id] => 0 [name] => PO DEE [score] => 2 [time] => 2588.15234375 [gq_name] => PO DEE [gq_score] => 2 [gq_ping] =>) [11] => Array ([id] => 0 [name] => TrapQueen [score] => 2 [time] => 890.21875 [gq_name] => TrapQueen [gq_score] => 2 [gq_ping] =>) [12] => Array ([id] => 0 [name] => (1)audi [score] => 1 [time] => 740.625 [gq_name] => (1)audi [gq_score] => 1 [gq_ping] =>) [13] => Array ([id] => 0 [name] => mevludin [score] => 1 [time] => 2053.35546875 [gq_name] => mevludin [gq_score] => 1 [gq_ping] =>) [14] => Array ([id] => 0 [name] => **DaN1 P0W3R** [score] => 0 [time] => 2584.4765625 [gq_name] => **DaN1 P0W3R** [gq_score] => 0 [gq_ping] =>) [15] => Array ([id] => 0 [name] => -_- [score] => 0 [time] => 1044.75390625 [gq_name] => -_- [gq_score] => 0 [gq_ping] =>) [16] => Array ([id] => 0 [name] => >>>AMG<<< [score] => 0 [time] => 8932.015625 [gq_name] => >>>AMG<<< [gq_score] => 0 [gq_ping] =>) [17] => Array ([id] => 0 [name] => >>MiTroBoYSs<< [score] => 0 [time] => 18368.73828125 [gq_name] => >>MiTroBoYSs<< [gq_score] => 0 [gq_ping] =>) [18] => Array ([id] => 0 [name] => [email protected][email protected] [score] => 0 [time] => 1043.4375 [gq_name] => [email protected][email protected] [gq_score] => 0 [gq_ping] =>) [19] => Array ([id] => 0 [name] => GiLAN [score] => 0 [time] => 4353.34375 [gq_name] => GiLAN [gq_score] => 0 [gq_ping] =>) [20] => Array ([id] => 0 [name] => ISCO [score] => 0 [time] => 30895.46484375 [gq_name] => ISCO [gq_score] => 0 [gq_ping] =>) [21] => Array ([id] => 0 [name] => Mr.I [score] => 0 [time] => 3309.33203125 [gq_name] => Mr.I [gq_score] => 0 [gq_ping] =>) [22] => Array ([id] => 0 [name] => Tony Cortes [score] => 0 [time] => 216.08203125 [gq_name] => Tony Cortes [gq_score] => 0 [gq_ping] =>) [23] => Array ([id] => 0 [name] => ViRuSi [score] => 0 [time] => 186.375 [gq_name] => ViRuSi [gq_score] => 0 [gq_ping] =>) [24] => Array ([id] => 0 [name] => ZekiGrandFather! [score] => 0 [time] => 154.90234375 [gq_name] => ZekiGrandFather! [gq_score] => 0 [gq_ping] =>) [25] => Array ([id] => 0 [name] => c0d3 [score] => 0 [time] => 53075.8046875 [gq_name] => c0d3 [gq_score] => 0 [gq_ping] =>) [26] => Array ([id] => 0 [name] => shuajbbiceps [score] => 0 [time] => 889.22265625 [gq_name] => shuajbbiceps [gq_score] => 0 [gq_ping] =>) [27] => Array ([id] => 0 [name] => theun [score] => 0 [time] => 890.125 [gq_name] => theun [gq_score] => 0 [gq_ping] =>) [28] => Array ([id] => 0 [name] => timi [score] => 0 [time] => 2130.37890625 [gq_name] => timi [gq_score] => 0 [gq_ping] =>) [29] => Array ([id] => 0 [name] => www.lspublic.com [score] => 0 [time] => 53075.8046875 [gq_name] => www.lspublic.com [gq_score] => 0 [gq_ping] =>)) [protocol] => 48 [round_version] => 1.3 [secure] => 1 [steamappid] => 10 [sv_accelera] => 5 [sv_aim] => 0 [sv_airaccelerate] => 10 [sv_allowupload] => 1 [sv_alltalk] => 0 [sv_bounce] => 1 [sv_cheats] => 0 [sv_clienttrace] => 1 [sv_contact] => [sv_friction] => 4 [sv_gravity] => 800 [sv_logblocks] => 0 [sv_maxrate] => 80000 [sv_maxspeed] => 900 [sv_minrate] => 70000 [sv_password] => 0 [sv_proxies] => 0 [sv_restart] => 0 [sv_restartround] => 0 [sv_stepsize] => 18 [sv_stopspeed] => 75 [sv_uploadmax] => 0.5 [sv_voiceenable] => 1 [sv_wateraccelerate] => 10 [sv_waterfriction] => 1 [utor_bomb_viewable_check_interval] => 0.5 [version] => 49 [vtc_version] => 80))
我不想顯示該玩家陣列([玩家] =>數組()
我想這個代碼,但不工作,他找到我唯一的結果:
<table>
<?php
require_once('../gameq.php');
$servers = array('server_'.$server_id => array($server_game, $server_ip, $server_port)) or die(mysql_error());
$gq = new GameQ();
$gq->addServers($servers);
$gq->setOption('timeout', 250);
$gq->setFilter('normalise');
$gq->setFilter('sortplayers');
$data = $gq->requestData();
if($data['server_'.$server_id]['gq_online'] == "1"){
foreach ($data as $datas => $value) {
echo "<tr>
<td>".htmlspecialchars($datas)."</td>
<td>".htmlspecialchars($value)."</td>
<tr>";
}
}
?>
</table>
它看起來像這將取決於'值$ server_id'。那個集合在哪裏? –
$ server_id,$ server_ip,$ server_port,否則我設置在頁面頂部 –
我修正了它..... –