I’m sure my title wasn’t really that helpful. What i’m trying to do is this, I have an array with names in them. I also have a dynamic array which is generated with a foreach from an external xml file. What I want to do is if a name(s) are found then echo each one out. I am still working on my PHP skills but I am at a loss at what to do to get this working the way I want it. I’ve searched for hours trying to find something that would work but nothing. I’m probably not searching right.
Here is the code that i’m trying to do.
// This just gets how many players ore on the US team
$serverplayer = $gameME_sdk_object->client_api_serverinfo("".$ip."/players/usarmy");
foreach($serverplayer['serverinfo'][0]['teams'] as $mainserver) {
if($mainserver['name'] == "usarmy") {
$dacount = $mainserver['count'];
}
}
if($dacount >= 1)
// Begins Admin List/Count
$admins = array("INFIDEL_HARE", "Romania191", "mardog104", "INFIDEL_JIHAD", "stvnsng", "HellKnightFire", "McThump", "INFIDEL_JByrns93", "INFIDEL_ALPHA", "s0ck37", "Zepppster", "xRingmasteressx", "FreeeKillz", "smokert", "Ccls2", "INFIDEL_GRIF", "cuzco2585", "Prophet731", "KittensDrunk", "Rexperience-EF", "Whickerbasket", "InfamousHoole", "Cruz_5326", "-Grimreaperx9-", "JoeyT2");
foreach($serverplayer['serverinfo'][0]['players'] as $admname) {
$Alist[] = $admname['name'];
if(in_array($Alist, $admins)) {
$adminlist = $admname['name'];
$countAlist = count($adminlist);
}
}
// Ends Admin List/Count
// Everything below is just the data
echo '<div class="four-columns six-columns-tablet twelve-columns-mobile">';
echo '<pre>';
echo $adminlist;
echo '</pre>';
echo "<div class=\"table-header\">US (".$dacount.")</div>";
echo '<table class="table responsive-table" id="scoreboard">';
echo '<thead>';
echo '<tr>';
echo '<th scope="col" width="2%">Sq</th>
<th scope="col">Name</th>
<th scope="col" width="2%">K</th>
<th scope="col" width="2%">D</th>
<th scope="col" width="5%" class="hide-on-mobile hide-on-tablet hide-on-mobile-portrait">Cheat Meter</th>';
echo '</tr></thead>';
echo '<tbody>';
foreach($serverplayer['serverinfo'][0]['players'] as $player) {
echo '<tr>';
if ($player['team'] == "unassigned" Xor $player['team'] == "None") {
$team = "<small class=\"tag green-gradient glossy\">Joining</small>";
}
echo "<td class=\"low-padding\">".ucfirst($player['squad'])."</td>";
echo "<td class=\"low-padding\"><a href=\"http://battlelog.battlefield.com/bf3/user/".$player['name']."\" target=\"_blank\"><img src=\"./img/battlelog.png\" alt=\"Battlelog Profile\" width=\"16\" height=\"16\"></a> ".$player['name']."<span style=\"float: right\">".$team."</span></th>";
echo '<td>'.$player['kills'].'</td>';
echo '<td>'.$player['deaths'].'</td>';
echo "<td><a href=\"http://panel.dev.adkgamers.com/?p=" . $player['name'] . "&id=cheatometer\"target=\"_blank\">Check</a></td>";
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
echo '</div>';
How would I go about doing this? If anyone knows how to or understands what i’m trying to do.
You need to change following your code