Sum of each element raised to ( prime | Function to return the required sum ; Driver code
< ? php function getSum ( $ arr , $ p ) { return count ( $ arr ) ; } $ arr = array ( 5 , 6 , 8 ) ; $ p = 7 ; echo ( getSum ( $ arr , $ p ) ) ; ? >