Below function checks whether product of digits at even places is divisible by sum of digits at odd places
< ? php function productSumDivisible ( $ n , $ size ) { $ sum = 0 ; $ product = 1 ; while ( $ n > 0 ) {