What this expression means * =

7

I would like to know what is the meaning of *= in both PHP and Javascript:

I have a JS function and I'm converting to PHP, so it came up with *= but I have no idea what it does.

In the question of function is right. I would just like to understand what it is for.

$b *= 200;
    
asked by anonymous 26.04.2015 / 17:48

1 answer

11

Simplified Answer

This is an abbreviated form of:

$b = $b * 200;

In the same way there are abbreviations for sum, division and multiplication

$b = $b - 200;
$b -= 200;
$b = $b + 200;
$b += 200;
$b = $b / 200;
$b /= 200;

More detailed response

This is a Operador Combinado where you combine a simple assignment (passing the value from one variable to another) with an arithmetic operation with the variable that will store the assignment (the result).

    
26.04.2015 / 17:56