Skip to content Skip to sidebar Skip to footer

Json Parse Error On Line 1: < Html > < Body >

i dont know why the code is not working, it should encode to json ? when i call this PHP code link from app in Android studio its not working and display error message ,it display

Solution 1:

Your Json is correct, the issue is your returning HTML, you're not telling the browser that the content is Json.

Use

header('Content-Type: application/json');
echo json_encode($response);

Solution 2:

i used another webhosting domain (000webhost) and its work without any problem with same code , i think the problem from (byethost) not from the code.

Post a Comment for "Json Parse Error On Line 1: < Html > < Body >"