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 10541054 </listitem >
10551055 </varlistentry >
10561056 </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 >
10571082 </listitem >
10581083 </varlistentry >
10591084
You can’t perform that action at this time.
0 commit comments