I can not understand how percent work in php.
For example:
php:
1%13 = 1 13%13 = 0 Calculator:
1%13 = 0.13 13%13 = 1.69 Please clarify what my problem is misunderstanding
I can not understand how percent work in php.
For example:
php:
1%13 = 1 13%13 = 0 Calculator:
1%13 = 0.13 13%13 = 1.69 Please clarify what my problem is misunderstanding
how do percent work in php
In PHP, the same as in mathematics: 1% == 0.01
echo 0.01 * 13; // 0.13 echo 0.13 * 13; // 1.69 The % symbol looks similar to the Percentage key of any calculator, but in PHP it is a modulo operator. As a result, you get the integer remainder of the division:
echo (2 % 2); // 0 echo (3 % 2); // 1 echo (4 % 2); // 0 Source: https://ru.stackoverflow.com/questions/907791/
All Articles
%in php is the operator of the remainder of the division. And your problem is that you do not want to open the manual for pkhp and get acquainted with it. - u_mulder Nov.