Round the given number to nearest multiple of 10 | function to round the number ; Smaller multiple ; Larger multiple ; Return of closest of two ; Driver Code
< ? php function roundFunation ( $ n ) { $ a = ( int ) ( $ n / 10 ) * 10 ; $ b = ( $ a + 10 ) ; return ( $ n - $ a > $ b - $ n ) ? $ b : $ a ; } $ n = 4722 ; echo roundFunation ( $ n ) , " STRNEWLINE " ; ? >