Forum Moderators: coopster
<?php
//What I am getting
$_POST["stats"];//my string
$string = $_POST["stats"];
//the regex
preg_match_all("/:\. Alliance Query Results ([\w\s%]+):\. Alliance Nation Statistics/", $string, $matches, PREG_PATTERN_ORDER);
//display it
foreach($matches[1] as $value)
{
echo "$value <br />";
}
?>
It seems as though that SHOULD Be correct, but its coming back blank.
For more detail here is what it should be looking for, and what it should return:
Looking For:
:. Alliance Query Results
Last Updated: 1/19/2010 5:30:03 PMAlliance NameTotal NationsActive NationsPercent ActiveStrengthAvg. StrengthScore
North Atlantic Defense Coalition 142 84 59% 4,463,948 31,436 16.73
:. Alliance Nation Statistics
Should Return:
Alliance NameTotal NationsActive NationsPercent ActiveStrengthAvg. StrengthScore
North Atlantic Defense Coalition 142 84 59% 4,463,948 31,436 16.73
Furthermore (though this is outside of the scope of my question... as I really just want this data).. if someone has an idea on how to combine the two sets of data that goes together, that would be greatly appreciated:
For instance Alliance Name != Total Nations Alliance Name == North Atlantic Defense Coalition (which is right under it).
Since the spaces are also constant, I was thinking of possibly just counting out how many spaces it was until the result for each one... or something. Anyway this is just icing ... I would really just like to know how to get my current script working.
[edited by: eelixduppy at 1:42 am (utc) on Jan. 20, 2010]
[edit reason] no URLs, please [/edit]