mill Posted June 30, 2008 Share Posted June 30, 2008 What im trying to do is export the Stats of wins / losses / % and last game played to add to a database, need some help making something that will pull all that information any ideas? if you look at the html page im linking you can see what i mean i want to call this info Last Ladder Game: Nov. 17th 2007 Ex: Undead: 39 36 52.00 Human: 39 36 52.00 Total: 55 55 93.3 and have it so i can insert it into a mysql database <?php $text = file_get_contents("http://www.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Azeroth&PlayerName=Dayvinn-"); if (preg_match("/Undead/", $text, $matches)) { echo "Match was found "; echo $matches[0]; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/ Share on other sites More sharing options...
sasa Posted June 30, 2008 Share Posted June 30, 2008 try <?php $text = file_get_contents("http://www.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Azeroth&PlayerName=Dayvinn-"); preg_match_all('/ranking(Header|Row)">([^<]*)</', $text, $out); $out = array_chunk($out[2], 4); print_r($out); ?> Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/#findComment-577794 Share on other sites More sharing options...
mill Posted July 1, 2008 Author Share Posted July 1, 2008 Thank you it does work outputs: Array ( [0] => Array ( [0] => [1] => Wins [2] => Losses [3] => Win % ) [1] => Array ( [0] => Random: [1] => 1 [2] => 8 [3] => 11.11 % ) [2] => Array ( [0] => Human: [1] => 259 [2] => 272 [3] => 48.78 % ) [3] => Array ( [0] => Orc: [1] => 5 [2] => 15 [3] => 25.00 % ) [4] => Array ( [0] => Undead: [1] => 39 [2] => 36 [3] => 52.00 % ) [5] => Array ( [0] => Night Elf: [1] => 57 [2] => 29 [3] => 66.28 % ) [6] => Array ( [0] => Total: [1] => 361 [2] => 360 [3] => 50.07 % ) Now say i wanted something from array [6],[1] Being: 361 how would i make that code? Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/#findComment-578746 Share on other sites More sharing options...
sasa Posted July 1, 2008 Share Posted July 1, 2008 $out[6][1] Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/#findComment-578794 Share on other sites More sharing options...
mill Posted July 2, 2008 Author Share Posted July 2, 2008 Thanks it works great... Ive been trying to get more info off the site but i can only pull up some of it..... Array ( [0] => Array ( [0] => Player Name: [1] => Clan Name: [2] => Homepage: [3] => Last Ladder Game: ) [1] => Array ( [0] => Play History: [1] => Exp: [2] => Rank: [3] => Wins: ) [2] => Array ( [0] => Losses: [1] => XP decay in: ) ) No matter what i try i can only pull up that info, is there a way to get whats after that? Im using this as my code preg_match_all('/ranking(Data)">([^<]*)</', $text, $out2); $out2 = array_chunk($out2[2], 4); print_r($out2); Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/#findComment-580443 Share on other sites More sharing options...
sasa Posted July 3, 2008 Share Posted July 3, 2008 can you post the URL from where you grab data Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/#findComment-581008 Share on other sites More sharing options...
mill Posted July 4, 2008 Author Share Posted July 4, 2008 http://www.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Azeroth&PlayerName=Dayvinn- Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/#findComment-581588 Share on other sites More sharing options...
mill Posted July 6, 2008 Author Share Posted July 6, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/112509-help-with-some/#findComment-583109 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.