从mixpanel API我得到newline-delimited JSON
作为响应。我需要将此信息存储在excel文件中,或者如何将此json响应转换为单个有效的json。如何使用PHP。任何人请建议
这是mixpanel的回应
{"event":"Login","properties":{"time":1445803474,"distinct_id":"601","$browser":"Chrome","$browser_version":46,"$city":"cityname","$current_url":"http://localhost","$initial_referrer":"$direct","$initial_referring_domain":"$direct","$lib_version":"2.7.1","$os":"Windows","$region":"Region name","$screen_height":768,"$screen_width":1366,"mp_country_code":"countrycode","mp_lib":"web","userName":"local@gmail.com"}}
{"event":"game","properties":{"time":1445803562,"distinct_id":"602","$browser":"Chrome","$browser_version":46,"$city":"cityname","$current_url":"http://localhost","$initial_referrer":"$direct","$initial_referring_domain":"$direct","$lib_version":"2.7.1","$os":"Windows","$region":"Region name","$screen_height":768,"$screen_width":1366,"mp_country_code":"countrycode","mp_lib":"web","userName":"local1@gmail.com"}}
答案 0 :(得分:0)
由于您要求使用PHP ...文档中提出了一个PHP客户端:https://mixpanel.com/docs/api-documentation/data-export-api#libs-php