Jump to content

help with php


mill

Recommended Posts

I need some info on how to start this project im working on I know some basic or php just looking for someone to help out

 

 

I need to use the fopen and maybe strip_tag to do this and i dont know where to start... I need to open a webpage take some information from it and insert it in to a data base...ie

 

 

 

if you go to page "http://www.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Azeroth&PlayerName=Dayvinn-"

 

and look in the left corner I need to get like the wins / losses and have them added to a data base with his username any ideas?

Link to comment
https://forums.phpfreaks.com/topic/112474-help-with-php/
Share on other sites

 

<?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 <br />";

  echo $matches[0];

}

?>

 

 

 

Thats my code to start testing it and it does work and does find it, how would i search for Undea: Then take the numbers after it in the string?

 

Undead:  39  36  52.00

 

is how it shows up i need to take the 39 36 and 52.00

Link to comment
https://forums.phpfreaks.com/topic/112474-help-with-php/#findComment-577490
Share on other sites

You will most likely need to use some regular expressions. You will need to view the HTML source to make your expressions. If you have trouble making them as they could be quite difficult depending on how the information is being displayed then I'd recommend post some of the HTML in the regex section of phpfreaks.

Link to comment
https://forums.phpfreaks.com/topic/112474-help-with-php/#findComment-577494
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.