note 104139 modified in function.abs by danbrown
| From: | danbrown@php.net | Date: | Wed, 25 May 2011 19:47:36 +0000 |
| Subject: | note 104139 modified in function.abs by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180041@lists.php.net to get a copy of this message | ||
If you don't have/want GMP and are working with large numbers/currencies:
<?php
function mb_abs($number)
{
return str_replace('-','',$number);
}
?>
No need to worry about encoding, as your numbers should all be basic (ANSI) strings.
--was--
If you don't have/want GMP and are working with large numbers/currencies:
function mb_abs($number)
{
return str_replace('-','',$number);
}
No need to worry about encoding, as your numbers should all be basic (ANSI) strings.
http://php.net/manual/en/function.abs.php