I have a code lik this
<?php
$jsonurl = "http://api.tamilmagazine.com/";
$json = file_get_contents($jsonurl,0,null,null);
$json_output = json_decode($json);
print_r($json_output);
?>
The above code returns a json response as.
stdClass Object
(
[mag_id] => 1
[mag_name] => ஆனநà¯à®¤ விகடனà¯
[sid] => 544
[bpath] => http://www.tamilmagazine.com/
[api_path] => http://api.tamilmagazine.com/
[categories] => Array
(
[0] => stdClass Object
(
[cat_id] => 25
[cat_name] => அரசியலà¯
[articles] => Array
(
[0] => stdClass Object
(
[aid] => 20053
[a_title] => தலையஙà¯à®•ம௠- கறà¯à®±à¯à®•௠கொடà¯à®™à¯à®•ள௠மேதைகளே...
[p_no] => 7
[weburl] => tamilmagazine/msite.php?type=article&mid=1
)
. . .. .. . . . . . . . . . . . . . . . . . . . and so on . . . .
When i view the given api (http://api.tamilmagazine.com/) in browser i am getting the correct font lik this.
{
"mag_id": "190987",
"mag_name": "தென்மேற்கு பருவமழை கேரளாவில் வரும் 5ம் துவங்கும் ",
"sid": "44",
"bpath": "http://www.tamilmagazine.com/",
"api_path": "http://api.tamilmagazine.com/",
"categories": [
{
"cat_id": "25",
"cat_name": "தென்மேற்கு பருவமழை கேரளாவில் வரும் 5ம் துவங்கும் ",
"articles": [
{
"aid": "3",
"a_title": "தென்மேற்கு பருவமழை கேரளாவில் வரும் 5ம் துவங்கும் ...",
"p_no": "7",
"weburl": "msitee.php?type=article&mid=1"
},
. .. . . . . and so on. . ...
In other words, my api url works fine in browser, whereas, the api url after php parsing did not work for me in my browser, showing some special characters (i dont know whether its unicode or ascii).
Please advice.
Thanks Haan