<?php
int|float abs ( int|float $num )
where,
$num = The numeric value to be processed
?>
<?php
function absval($val01, $loc01)
{
if($loc01 == 0)
{
setlocale(LC_ALL, "en_US", "en-US", "american",
"american english", "american-english",
"english-american", "english-us",
"english-usa", "enu", "us", "usa");
echo abs($val01) . ' = | ' . $val01 . ' |<br><br>';
}
else
{
setlocale(LC_ALL, "pt_BR.utf-8", "pt-BR.utf-8",
"portuguese-brazil", "ptb");
echo abs($val01) . ' = | ' . $val01 . ' |<br><br>';
}
}
echo 'LOCALE = en_US<br><br>';
absval(234, 0);
absval(-234, 0);
absval(4.3456, 0);
absval(-4.3456, 0);
absval(-1.3E+19, 0);
absval(1.3E+19, 0);
absval(M_PI, 0);
echo 'LOCALE = pt_BR<br><br>';
absval(234, 1);
absval(-234, 1);
absval(4.3456, 1);
absval(-4.3456, 1);
absval(-1.3E+19, 1);
absval(1.3E+19, 1);
absval(M_PI, 1);
?>