2017-05-03 98 views
-3

**這是我的字符串,,,,請幫忙[我用動作腳本3,但你可以在任何語言回答' 我只想要名字和ID **我想分解太長的字符串

「{ 「數據」:[{ 「名稱」: 「fhfgdhg」, 「ID」: 「1324231864276217」},{ 「名稱」: 「fhfdhfh」, 「ID」: 「1197660730326224」}, { 「名」: 「fhdhfgh」, 「ID」: 「1131720603601900」},{ 「名」: 「fdhfdghfg」, 「ID」: 「610530709133257」},{ 「名」: 「dfghfdh」, 「ID」:」 580102228843815 「},{」 名 「:」 fdhfhfh 「 」ID「: 」657695841092832「},{ 」名「: 」dhfhf「, 」ID「: 」1878237492447644「},{ 」名「: 」dfghfgdh「,」 「ID」:「358290074522881」},{「name」:「fdhf」,「id」:「199052413834818」},{「name」:「dghfdgh」,「id」:「107884723111778」}], 「paging」 { 「遊標」:{ 「之前」:「QVFIUldoTlJGTXVoOV9pUE54ZAklvNDc5 YkRoWVRQYkE3T1pXcXNzeXJoN3I0QUt4ZAmlLVkxCanVYMzRzd3hUWTRZAdDNVQVI0YlpWT3pIZAjJXUHFvXzd6Q1BR」, 「後」: 「QVFIUnQ1Wmgzb2E1VEhEV2xiTFIwYU10dkFQcUtaV2pQbVJNVlR5SWQ2T1NRMThsUUJXYi1IdklKdjl1NkkzZAmRSMTdESXd4bkJtMXZAXalViOEItUWhWaFFn」}}, 「摘要」:{ 「TOTAL_COUNT」:1636}}」

+0

你要什麼你的輸出呢?你有什麼嘗試? – Claudi

+0

我只想要姓名和ID –

+1

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/JSON.html – Organis

回答

1

PHP:

$string = '{"data":[{"name":"fhfgdhg","id":"1324231864276217"},{"name":"fhfdhfh","id":"1197660730326224"},{"name":"fhdhfgh","id":"1131720603601900"},{"name":"fdhfdghfg","id":"610530709133257"},{"name":"dfghfdh","id":"580102228843815"},{"name":"fdhfhfh","id":"657695841092832"},{"name":"dhfhf","id":"1878237492447644"},{"name":"dfghfgdh","id":"358290074522881"},{"name":"fdhf","id":"199052413834818"},{"name":"dghfdgh","id":"107884723111778"}], "paging":{"cursors":{"before":"QVFIUldoTlJGTXVoOV9pUE54ZAklvNDc5YkRoWVRQYkE3T1pXcXNzeXJoN3I0QUt4ZAmlLVkxCanVYMzRzd3hUWTRZAdDNVQVI0YlpWT3pIZAjJXUHFvXzd6Q1BR", "after":"QVFIUnQ1Wmgzb2E1VEhEV2xiTFIwYU10dkFQcUtaV2pQbVJNVlR5SWQ2T1NRMThsUUJXYi1IdklKdjl1NkkzZAmRSMTdESXd4bkJtMXZAXalViOEItUWhWaFFn"}}, "summary":{"total_count":1636}}'; 
$string = json_decode($string); 
foreach($string as $s) { 
    foreach($s as $s2) { 
    echo $s2->name; 
    echo $s2->id; 
    } 
}