hi, Its a silly question but there is some issue in my calculation, as when i do
8535902775%10 it show -7 on my php compiler
however i expect as it shuold be 5 i know modulo thing as currently i am not able to find my istake my program is:
- <?php
- $isbn=8535902775;
-
- $array='0';
- for($i = 1; $i<=10;$i++){
- $array += $isbn % 10;
- $isbn = $isbn/10;
- $array = $array * $i;
- }
- if($array/11 == 0){
- echo "Valid";
- }else{
- echo "Not Valid";
- }
- ?>