PHP 8.5.0 Alpha 1 available for testing

Voting

: max(five, six)?
(Example: nine)

The Note You're Voting On

zfcb13 at gmail dot com
9 years ago
More elegant function with selection of decimal point (deafault ,):
<?php
function floatvaldec($v, $dec=',') { return floatval(ereg_replace("," , "." , ereg_replace("[^-0-9$dec]","",$v))); }

// examples:
echo '<br>'.floatvaldec('somthing123.456.789,12Euro') ;
echo
'<br>'.floatvaldec('x123,456 789.12 Euro', '.') ;
echo
'<br>'.floatvaldec('123.456 789,12$') ;
?>

<< Back to user notes page

To Top