Volume of biggest sphere within a right circular cylinder | Function to find the biggest sphere ; radius and height cannot be negative ; radius of sphere ; Driver code
< ? php function sph ( $ r , $ h ) { if ( $ r < 0 && $ h < 0 ) return -1 ; $ R = $ r ; return $ R ; } $ r = 4 ; $ h = 8 ; echo sph ( $ r , $ h ) ; ? >