我想.split一个太长的字符串

时间:2017-05-03 11:48:57

标签: actionscript-3 split

**这是我的字符串,,,,请帮助[我使用动作脚本3,但你可以回答任何语言'] 我只想要名字和身份证明 **

' {"数据":[{"名称":" fhfgdhg"" ID":& #34; 1324231864276217"},{"名称":" fhfdhfh"" ID":" 1197660730326224"},{&# 34;名称":" fhdhfgh"" ID":" 1131720603601900"},{"名称":" fdhfdghfg& #34;" ID":" 610530709133257"},{"名称":" dfghfdh"" ID" :" 580102228843815"},{"名称":" fdhfhfh"" ID":" 657695841092832"},{ "名称":" dhfhf"" ID":" 1878237492447644"},{"名称":&#34 ; dfghfgdh"" ID":" 358290074522881"},{"名称":" fdhf"" ID&# 34;:" 199052413834818"},{"名称":" dghfdgh"" ID":" 107884723111778"} ] "寻呼" {"光标" {"前":" QVFIUldoTlJGTXVoOV9pUE54ZAklvNDc5YkRoWVRQYkE3T1pXcXNzeXJoN3I0QUt4ZAmlLVkxCanVYMzRzd3hUWTRZAdDNVQVI0YlpWT3pIZAjJXUHFvXzd6Q1BR&#34 ;, "后":" QVFIUnQ1Wmgzb2E1VEhEV2xiTFIwYU10dkFQcUtaV2pQbVJNVlR5SWQ2T1NRMThsUUJXYi1IdklKdjl1NkkzZAmRSMTdESXd4bkJtMXZAXalViOEItUWhWaFFn"}}, "总结" {" TOTAL_COUNT":1636}}'

1 个答案:

答案 0 :(得分: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;
  }
}