PHP
Advertisement

Description[]

abs returns the absolute value of input. The type of the returned value depends on the type of input. It will be will float if the type of input is also float. Otherwise the return value will be of type integer.

Note that if the type of input isn't float or integer the value will be converted to integer.

Parameters[]

{{{returns}}} abs (mixed number)

Parameter Infos[]

Parameter PHP Version Type
abs 4 or 5 returns mixed (integer, float)
number 4 or 5 mixed (integer, float, string, array)


Examples[]

Example 1:[]

<?php
//upper cse to lower case and wise versa
$rhyme="am a good girl";
$ucstr=strtoupper($rhyme);
echo $ucsrt;
?>

Output[]

3
3
2.4


For more details on this function, visit its entry in the php manual.
Advertisement