kirill578 Posted February 21, 2011 Share Posted February 21, 2011 I have some page that generates JSON array but the problem that java script ajax can't recognize it as a JSON code because it begins in the third line of the output ( press CTRL+U to see it ) I found out that the problem is my function php page that is Included ( include() ) there. but this function page doesn't send any output?! what is the problem!? http://maadif.co.cc/stuff/ajax_request.php Quote Link to comment https://forums.phpfreaks.com/topic/228429-output-starst-on-the-third-line/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 21, 2011 Share Posted February 21, 2011 what is the problem!? You didn't post enough of your code that produces/reproduces the problem. How could anyone here be able to tell you what is wrong with your php code without seeing the portion of it that produces the output? Quote Link to comment https://forums.phpfreaks.com/topic/228429-output-starst-on-the-third-line/#findComment-1177833 Share on other sites More sharing options...
PaulRyan Posted February 21, 2011 Share Posted February 21, 2011 Most likely it's spacing between 2 sets of PHP tags, or the output is given extra linebreak or whatever Try using trim() on the output to remove extra whitespaces. Also try to remove any spacing between PHP tags, this is usally the issue. Regards, PaulRyan. Quote Link to comment https://forums.phpfreaks.com/topic/228429-output-starst-on-the-third-line/#findComment-1177836 Share on other sites More sharing options...
kirill578 Posted February 22, 2011 Author Share Posted February 22, 2011 Thanks, the problem was 3 blank lines at after the ?> tag Quote Link to comment https://forums.phpfreaks.com/topic/228429-output-starst-on-the-third-line/#findComment-1178251 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.