Oh yea, if you know regular expressions you can do anything. For example, this is how easy it is to get the html of a website...
Then with regular expressions you can just pick it apart. For instance this is how easy it is to get every espn game id for that day
Now in my $gameIDs variable, I have an array with every gameID for that day, so I can then loop through those and go to the boxscores to extract the player data and in the database it would all be tied to that game id.
Just something to think about if you ever wanted to expand.
Code:
$url = 'http://scores.espn.go.com/mlb/scoreboard?date='.$espnDate; //get the contents of the page $handle = file_get_contents($url); $str = htmlentities($handle);
Code:
$pattern = '/(\d*)-gamebox/'; preg_match_all($pattern,$str,$gameIDs);
Just something to think about if you ever wanted to expand.