Check whether the point ( x , y ) lies on a given line | Function that return true if the given point lies on the given line ; If ( x , y ) satisfies the equation of the line ; Driver code
< ? php function pointIsOnLine ( $ m , $ c , $ x , $ y ) { if ( $ y == ( ( $ m * $ x ) + $ c ) ) return true ; return false ; } $ m = 3 ; $ c = 2 ; $ x = 1 ; $ y = 5 ; if ( pointIsOnLine ( $ m , $ c , $ x , $ y ) ) echo " Yes " ; else echo " No " ; ? >