I'm Sorry I was not more clear or failed to provide enough information.
Please excuse my messy code. I'm learning 🙂
preg_match_all( "/\<Player\>(.*?)\<\/Player\>/s",
$contents , $data );
foreach( $data[1] as $value )
{
preg_match_all( "/\<Name\>(.*?)\<\/Name\>/",
$value, $name );
preg_match_all( "/\<Score\>(.*?)\<\/Score\>/",
$value, $score );
preg_match_all( "/\<Kills\>(.*?)\<\/Kills\>/",
$value, $kills );
preg_match_all( "/\<Deaths\>(.*?)\<\/Deaths\>/",
$value, $deaths );
preg_match_all( "/\<TOP\>(.*?)\<\/TOP\>/",
$value, $top);
preg_match_all( "/\<Ping\>(.*?)\<\/Ping\>/",
$value, $ping);
preg_match_all( "/\<IP\>(.*?)\<\/IP\>/",
$value, $ip);
preg_match_all( "/\<Round\>(.*?)\<\/Round\>/s",
$value, $rnd);
preg_match_all( "/\<Nr\>(.*?)\<\/Nr\>/",
$value, $nr );
preg_match_all( "/\<V\>(.*?)\<\/V\>/",
$value, $v );
preg_match_all( "/\<W\>(.*?)\<\/W\>/",
$value, $w );
preg_match_all( "/\<Dmg\>(.*?)\<\/Dmg\>/",
$value, $dmg );
preg_match_all( "/\<Kill\>(.*?)\<\/Kill\>/",
$value, $rndkill );
preg_match_all( "/\<L\>(.*?)\<\/L\>/",
$value, $l );
preg_match_all( "/\<B\>(.*?)\<\/B\>/",
$value, $b );
preg_match_all( "/\<H\>(.*?)\<\/H\>/",
$value, $h);
echo " Player=> " .$name[1][0].
"<br> Score=> ". $score[1][0] .
"<br> Kills=> ". $kills[1][0].
"<br> deaths => " .$deaths[1][0].
" <br> TOP=> " .$top[1][0].
"<br> ping=> " .$ping[1][0].
"<br> IP=> <Hidden>
<br>";
$name=$name[1][0];
$score=$score[1][0];
$kills= $kills[1][0];
$deaths=$deaths[1][0];
$top=$top[1][0];
$ping=$ping[1][0];
$ip=$ip[1][0];
for($i=0; $nr[1][$i]; $i++)
for($i=0; $v[1][$i]; $i++)
{ {
echo
" round=>" . $nr[1][$i].
" Vic=>" . $v[1][$i].
" Weapon=> ". $w[1][$i] .
" dmg => ". $dmg[1][$i] .
" got kill => ". $rndkill[1][$i] .
" Leg=> ". $l[1][$i] .
" Body=> ". $b[1][$i] .
" Head => ". $h[1][$i] .
"<br><br>";
}}
This script reads from a xml file Located Here
This is the output on my page The page
Sorry for the messy output. I just wrote it fast to see the results and they are just temporary.
You can see when each players round's are done, the vic's keep going. Those vic's actually belong grouped with round and are misplaced.
From the xml file
<round>
records a new round. There may be more then one vic round.
</round>