Sorry, no doubt a really basic question... but I haven't found a possible duplicate.
If at the end of a php script called using $.getJSON() I have a line like this:
return json_encode( $paras_of_interest );
... everything works fine ... until there is some php output (inadvertently by an echo command, or perhaps due to a warning or error being generated by the php code)... this then completely disables/stops/messes up the return of the JSON object. What's the best way of dealing with this situation? How can one find out what code was output (i.e. where does it "go"?) ... and is there a way of configuring where output goes in this situation?
later apologies to Dezigo and Salman A: all 3 were excellent answers but I had to choose one