Program to find the percentage of difference between two numbers | Function to calculate the percentage ; Driver Code ; Function calling
< ? php function percent ( $ a , $ b ) { $ result = 0 ; $ result = ( ( $ b - $ a ) * 100 ) / $ a ; return $ result ; } $ a = 20 ; $ b = 25 ; echo percent ( $ a , $ b ) . " % " ; ? >