Divide every element of one array by other array elements | Function to calculate the quotient of every element of the array ; Calculate the product of all elements ; To calculate the quotient of every array element ; Driver code
< ? php function calculate ( $ a , $ b , $ n , $ m ) { $ mul = 1 ; for ( $ i = 0 ; $ i < $ m ; $ i ++ ) if ( $ b [ $ i ] != 0 ) $ mul = $ mul * $ b [ $ i ] ; for ( $ i = 0 ; $ i < $ n ; $ i ++ ) { $ x = floor ( $ a [ $ i ] / $ mul ) ; echo $ x , " " ; } } $ a = array ( 5 , 100 , 8 ) ; $ b = array ( 2 , 3 ) ; $ n = count ( $ a ) ; $ m = count ( $ b ) ; calculate ( $ a , $ b , $ n , $ m ) ; ? >