php abs () function syntax

php abs () function syntax

abs () function how to use?

action ABS () function returns the absolute value is a number. The syntax is abs (number), if the argument number is float, return type is also float, otherwise it returns integer (as float usually has a bigger value range than integer). Marble platform specifications

Action: action ABS () function returns the absolute value is a number

Syntax: abs (number)

parameter:

Parameter Description number must be a number

Description: Returns the absolute value of the parameter, if the parameter is a float, the return type is float, if the parameter is int, return type int, if the parameter string is a string, 0 is returned;

php abs () function examples

<?php

$i = -100;

$j = abs($i);

$a = 6.7;

$b = abs($a);

$k = "hello world";

$c = abs($k);

echo $j."*****".$b."*****".$c;

?>

  

 

Guess you like

Origin www.cnblogs.com/furuihua/p/11881155.html