php8.5
Home/ Manual/ com / functions/ variant_sub

variant_sub

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Subtracts the value of the right variant from the left variant value

Description

variant_sub(mixed $left, mixed $right): variant

Subtracts right from left.

Parameters

left

The left operand.

right

The right operand.

Variant-arith

Return Values

IfThen
Both expressions are of the string typeSubtraction
One expression is a string type and the other a characterSubtraction
One expression is numeric and the other is a stringSubtraction.
Both expressions are numericSubtraction
Either expression is NULLNULL is returned
Both expressions are emptyEmpty string is returned

Errors/Exceptions

Throws a com_exception on failure.

See Also

Source: reference/com/functions/variant-sub.xml · from the official PHP manual (php/doc-en)