I have two arrays with the year's results.
array A (
[a] => '150'
[b] => '200'
[c] => '300'
[d] => '1000'
[e] => '350'
[f] => '1000'
)
array B (
[a] => '500'
[b] => '400'
[d] => '1000'
[f] => '1000'
)
I need to compare the growth results between the two building another array, to show it in a html table. Ex:
[a] => 233%
[b] => 100%
...
I have a array identifying the indexes that are not present on array b. array c = ('c', 'e');
The thing is, I need the row C and E to still be displayed on the table. But on the iteration, how can i just jump the line with this indexes that have 0 value avoiding calculation 300 by 0 and putting a message instead?
$a[x] / $b[x]2. Write your display logic that takes this array and turns it into HTML according to whatever rules you want to define. 3. Remember that the results of division are floating point numbers, and you cannot reliably compare floats for equivalence. 4.if( abs($c[x] < .00001 ) { echo 'it is zero...ish'; }or whatever suitably small fraction that you find acceptable.