-2

以下のjson配列があります。

{"entries":[{"uid":155551338258538,"photo":"https:\/\/m.ak.fbcdn.net\/profile.ak\/hprofile-ak-prn1\/323887_155551338258538_1152153357_q.jpg","type":"user","text":"shikhadamodar","path":"\/shikha.damodar.1","category":"Madiun","names":["shikhadamodar"],"index_rank":-1,"needs_update":true,"non_title_tokens":"madiun"},{"uid":155551332173428,"photo":"https:\/\/m.ak.fbcdn.net\/profile.ak\/hprofile-ak-snc3\/273318_155551332173428_2131571532_q.jpg","type":"user","text":"shreya damodar","path":"\/my.devprofile","category":"Nilai","names":["shreyadamodar"],"index_rank":-1,"needs_update":true,"non_title_tokens":"nilai"},{"uid":155555587232111,"photo":"https:\/\/m.ak.fbcdn.net\/profile.ak\/hprofile-ak-prn1\/41332_155555587232111_3158_q.jpg","type":"user","text":"neha neha","path": "\/neha.neha34","category":"New York, New York","names":["Neha neha"],"index_rank":-1,"needs_update":true,"non_title_tokens":"new york, new york"}],"token":"1333551453-7","display_token":5,"display_ttl":1333541132}

このjson配列をデコードすると、

array(4){["entries"]=>array(3){[0]=>array(10){["uid"]=>float(1.5555133825854E+14)["photo"]=>string(90) "https://m.ak.fbcdn.net/profile.ak/hprofile-ak-prn1/323887_155551338258538_1152153357_q.jpg"["type"]=>string(4) "user"["text"]=>string(13) "shikhadamodar"["path"]=>string(17) "/shikha.damodar.1"["category"]=>string(6) "Madiun"["names"]=>array(1){[0]=>string(13) "shikhadamodar"}["index_rank"]=>int(-1)["needs_update"]=>bool(true)["non_title_tokens"]=>string(6) "madiun"}[1]=>array(10){["uid"]=>float(1.5555133217343E+14)["photo"]=>string(90) "https://m.ak.fbcdn.net/profile.ak/hprofile-ak-snc3/273318_155551332173428_2131571532_q.jpg"["type"]=>string(4) "user"["text"]=>string(14) "shreya damodar"["path"]=>string(14) "/my.devprofile"["category"]=>string(5) "Nilai"["names"]=>array(1){[0]=>string(13) "shreyadamodar"}["index_rank"]=>int(-1)["needs_update"]=>bool(true)["non_title_tokens"]=>string(5) "nilai"}[2]=>array(10){["uid"]=>float(1.5555558723211E+14)["photo"]=>string(83) "https://m.ak.fbcdn.net/profile.ak/hprofile-ak-prn1/41332_155555587232111_3158_q.jpg"["type"]=>string(4) "user"["text"]=>string(9) "neha neha"["path"]=>string(12) "/neha.neha34"["category"]=>string(18) "New York,New York"["names"]=>array(1){[0]=>string(9) "Neha neha"}["index_rank"]=>int(-1)["needs_update"]=>bool(true)["non_title_tokens"]=>string(18) "new york,new york"}}["token"]=>string(12) "1333551453-7"["display_token"]=>int(5)["display_ttl"]=>int(1333541132)}

json の最初の UID は "uid":155551338258538,

配列になると、["uid"]=>float(1.5555133825854E+14)

なんでそうなの??

結果を取得した後1.5555133825854E+14、それを実際の UID に変更でき155551338258538 ますか?

素晴らしいコーダーがこれに役立つことを願っています。

4

1 に答える 1

1

UID文字列が長い整数であるため、json_decodeが科学表記法に変換しているという問題の解決策を見つけました。これを試して

print_r(json_decode($arr, false,512, JSON_BIGINT_AS_STRING)); 
于 2013-04-23T05:37:12.283 に答える