Quote:
|
Originally Posted by fyrestrtr
Try these sets of steps
1. Get the index of the Quantity line.
|
Not exactly sure what that means... but if it means "get the total number of pairs....
$pcount = preg_match_all( '/CCCCFF/', $myLine, $dummy );
the TDs with the quantities has that as a BG color and it isn't used elsewhere, and $pcount does indeed return the correct number of pairs.
Quote:
|
Originally Posted by fyrestrtr
2. for ($x = index of quantity line; $x != (next line that doesn't match Quantity) && $x!=(next line that matches Price); $x++)
|
I thought I could use variable variables for something like..
if (preg_match("/Quantity/", "$line[$x]")){
$p="1";
while ($p < $pcount){
if (preg_match("[0-9]+", "$line[$x]")){$q{"$p"}=$line[$x+$p]; $p++;}
}
}
I was hoping to generate vairables to store the quantities
$q1, $q2 etc...
and then the same routine to generate $p1, $p2 ... But I apparently don't understand variable variables
Quote:
|
Originally Posted by fyrestrtr
3. In that for loop, grab all the quantities (stick them in an array)
4. Repeat the same for the Price line. (stick these in an array also)
Now you'll have two arrays that have the prices and quantity numbers. If you could have gotten this information as XML, it would have made this step real easy.
|