Comparaison des flotteurs php
// You cannot compare float values like you would compare intergers in PHP
// since a float is calculated and may not have the exact value as shown
// an easy way to get around this is to round the float, then convert the float
//to a string for the comparison
$a = 1.5;
$b = 1.5;
$a = round($a, 2);
$b = round($b, 2);
if (strval($a) === strval($b)) var_dump('it matches!');
Just Make It Global