Allow both periods and Es when filtering?

So I am using
filter_var($kcat, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_SCIENTIFIC)."," .

To filter user input. However, scientific notation doesn’t do much good if I can’t use periods. So I tried to change it to:

filter_var($kcat, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_SCIENTIFIC, FILTER_FLAG_ALLOW_FRACTION)."," .

But that just tells me
Warning: filter_var() expects at most 3 parameters, 4 given

So how can I make these filters actually usable?

[php]$kcat=“7-3f+4.2pp”;
$string = filter_var($kcat, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION | FILTER_FLAG_ALLOW_SCIENTIFIC);
echo $string;
// Outputs: 7-3+4.2[/php]

Notice the pipe | in between the second and third constants instead of a comma.

Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service