"." ',' FILTER_VALIDATE_FLOAT?
filter_input PHP HTML. . , , , . FILTER_VALIDATE_FLOAT , .
, , 123.45
.
$money = filter_input(INPUT_POST, 'money', FILTER_VALIDATE_FLOAT, array('options' => array('decimal' => ',')));
/ ?
+3
Kevin Salvesen
1
filter_var
filter_input
hd str_replace
. :
$temp_money = str_replace(".", ",", $_POST['money']);
$money = filter_var($temp_money, FILTER_VALIDATE_FLOAT, array('options' => array('decimal' => ',')));
$_POST['money']
null, $money
null, , filter_input
, .
+5
Kevin Salvesen