Hello friends I have two arrays called
var $conversion_rates;
and
var $LastUpdate_rates;
now I am updating them in my class with values . If you do var_dump() both of them you get values like this
echo "This is conversion rates<br>".var_dump( $this->conversion_rates = $rates_array);
array(1) { [11]=> float(507.6) } This is conversion rates
echo "This is conversion rates<br>".var_dump($this->LastUpdate_rates = $this->checkRatesFile());
array(1) { [11]=> string(6) "507.60" } This is LastUpdate Rates
Then I am trying to do is this
if( count(array_diff($this->conversion_rates, $this->LastUpdate_rates)) >0){
//do something ......
}
The if statement is always true because the array value are different so I want to change one of the array to float what should I do
$float1 == $float2is very prone to errors due to float (in)accuracy to begin with. A simplearray_diffwill probably never get you there.