Signatur
abs(int|float $num): int|float
Beschreibung
Gibt den nicht-negativen Wert zurück.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $num Pflicht | int|float | — | Zahl. |
Rückgabewert
Typ
int|float
Beschreibung
Absoluter Wert.
Beispiele
Basis
<?php
echo abs(-42); // 42
echo abs(-3.14); // 3.14