In C#/.NET, I can use Trace.Write or Debug.Write to output application specific diagnostics. What would be the equivalent in PHP? echo is outputting to my web page which I don't want.
You could write data to the error_log using error_log()
Via the second argument you can select the type of logging you want, such as file logging, system logging or even email.