Multiplication¶
Multiplication is the mathematical multiplication. It applies to numbers: integers and float.
It also works with booleans and null, which are first converted to integers. Other types are not allowed for multiplication and yield a fatal error.
The operator for multiplication is the star *. A double star ** is the power operator. The opposite operation is the division \.
<?php
$a = 10 * 2.3; // 23.0
$b = 0.5 * 2; // 1
?>
See also Array operators and Combining arrays using + versus array_merge in PHP.
Related : Array, integer, Floating Point Numbers, Exponent, Division, Exponent, Modulo, one, Single, Star *