note 71195 deleted from function.str-replace by felipe
| From: | felipe@php.net | Date: | Sun, 06 Jan 2008 12:47:39 +0000 |
| Subject: | note 71195 deleted from function.str-replace by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134872@lists.php.net to get a copy of this message | ||
Note Submitter: canudos01 at yahoo dot com dot br
----
In BRAZIL we use comma "," insted of dot "." to decimals numbers i use this to
convert a user input.
<?php
$valor1 = $_POST["valor1"];
$vir = ',';
$pon = '.';
$v1 = str_replace($vir,$pon, $valor1);
$valor2 = $_POST["valor2"];
$vir = ',';
$pon = '.';
$v2 = str_replace($vir,$pon, $valor2);
function soma($v1,$v2)
{
return $v1+$v2 ;
}
echo soma ($v1,$v2) ;
?>
I hope this help someone