File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1054
1054
</listitem >
1055
1055
</varlistentry >
1056
1056
</variablelist >
1057
+ <warning >
1058
+ <simpara >
1059
+ If the <constant >FILTER_FLAG_ALLOW_FRACTION</constant > flag is not used,
1060
+ then the decimal separator is removed, altering the value received.
1061
+ </simpara >
1062
+ <informalexample >
1063
+ <programlisting role =" php" >
1064
+ <![CDATA[
1065
+ <?php
1066
+ $number = '12.34';
1067
+
1068
+ var_dump(filter_var($number, FILTER_SANITIZE_NUMBER_FLOAT));
1069
+ var_dump(filter_var($number, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
1070
+ ?>
1071
+ ]]>
1072
+ </programlisting >
1073
+ &example.outputs;
1074
+ <screen >
1075
+ <![CDATA[
1076
+ string(4) "1234"
1077
+ string(5) "12.34"
1078
+ ]]>
1079
+ </screen >
1080
+ </informalexample >
1081
+ </warning >
1057
1082
</listitem >
1058
1083
</varlistentry >
1059
1084
You can’t perform that action at this time.
0 commit comments