|
Posted by NC on 10/07/13 11:36
sanfranc415@gmail.com wrote:
>
> .90 is the percent that 20 is of 220.
Not really... 20 is 9.090909...% of 220...
> Do you have a sample that might lead me the right direction?
Let's see...
$line1 = 'test test test description (100-10-0, 6700 test)';
$line2 = 'test test test description (100-10-0, 6350 test)';
list(, $temp) = explode('(', $line1);
list($temp,) = explode(',', $temp);
list($n11, $n12, $n13) = explode('-', $temp);
list(, $temp) = explode('(', $line2);
list($temp,) = explode(',', $temp);
list($n21, $n22, $n23) = explode('-', $temp);
echo $n11+$n21, '-', $n12+$n22, ' ',
number_format(1-($n12+$n22)/($n11+$n21+$n12+$n22),4);
That's it, really...
Cheers,
NC
Navigation:
[Reply to this message]
|