XAMPP 1.7.4 and if i run a php file with json encoded it works fine in localhost but if i migrate this to server the request receiving in the server is NULL, i don't know what is wrong and even for simple program its not working
This is my code
<?php header('Content-type:application/json; charset:utf-8');
if(isset($_GET['request']))
{
$str = $_GET['request'];
$arr=json_decode($str, true);
$username2 = $arr['username'];
echo json_encode($username2);
}
?>
This is my Request filename.php?request={username:kavi}
If i run this in localhost my output is kavi
If i run this in server my output is nothing
I checked by using var_dump() but its showing NULL
Can any one help me please....?
var_dump(json_decode('{username:kavi}', TRUE));output on your localhost? Pretty sure it'sNULL.