使用php解析Foursquare json响应

时间:2022-09-07 10:11:08

I have a json response which was listing the near by places in foursquare , But i cant parse and show it using php , Here is the response i got

我有一个json响应,它列出了foursquare近距离的位置,但是我不能用php解析和显示它,这是我得到的响应

     "{"meta":{"code":200},"response":{"neighborhoods":[],"venues":[{"id":"4c8a4a729ef0224b4861597b","name":"Domino's Pizza","contact":{},"location":{"address":"Landship Mall","lat":11.258859817080253,"lng":75.78049986984433,"distance":15,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":
[{"id":"4bf58dd8d48988d1ca941735","name":"Pizza Place","pluralName":"Pizza Places","shortName":"Pizza","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/pizza_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":230,"usersCount":113,"tipCount":8},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},
    {"id":"4dd4947b22716ea3ce61c577","name":"KFC","contact":{},"location":{"address":"Holiday City Centre","crossStreet":"Bank Road","lat":11.259231792131327,"lng":75.7804848253727,"distance":53,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":{"id":"4ffaf6ede4b024f55b8a67a7","name":"Dubai Bazar","contact":{},"location":{"address":"Opp Gulf Bazar","crossStreet":"Bank Road","lat":11.258383964520572,"lng":75.780664493572,"distance":49,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[],"verified":false,"stats":{"checkinsCount":44,"usersCount":24,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4cc1a3cb53f6b71336237df8","name":"Shoe Factory","contact":{},"location":{"address":"Focus Mall, Rajaji Road","lat":11.258749384434863,"lng":75.78040904287909,"distance":0,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d107951735","name":"Shoe Store","pluralName":"Shoe Stores","shortName":"Shoes","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/apparel_shoestore_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":5,"usersCount":4,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"5076a3e2e4b0abe31a24b39d","name":"Nike","contact":{},"location":{"lat":11.258749384434863,"lng":75.78040904287909,"distance":0,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d107951735","name":"Shoe Store","pluralName":"Shoe Stores","shortName":"Shoes","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/apparel_shoestore_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":9,"usersCount":5,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4fb62920e4b0aced0a7e65d9","name":"4in Bazar","contact":{},"location":{"lat":11.258903822420683,"lng":75.78080641042673,"distance":46,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4f04afc02fb6e1c99f3db0bc","name":"Mobile Phone Shop","pluralName":"Mobile Phone Shops","shortName":"Mobile Phone","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/mobilephoneshop_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":51,"usersCount":23,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4daa61f190a0fde2ea426783","name":"Dakshin","contact":{},"location":{"address":"Opp. Canon Showroom","crossStreet":"Marovar Rd.","lat":11.25928769956318,"lng":75.781345693192,"distance":118,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d1d3941735","name":"Vegetarian \/ Vegan Restaurant","pluralName":"Vegetarian \/ Vegan Restaurants","shortName":"Vegetarian \/ Vegan","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/vegetarian_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":74,"usersCount":47,"tipCount":4},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4bb6af382f70c9b613de8530","name":"Paragon Restaurant","contact":{"phone":"+914952767020","formattedPhone":"+91 495 276 7020"},"location":{"address":"Kannur Road","lat":11.25674153640481,"lng":75.77957153320312,"distance":241,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d10f941735","name":"Indian Restaurant","pluralName":"Indian Restaurants","shortName":"Indian","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/indian_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":801,"usersCount":442,"tipCount":54},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4fe84256e4b09e82668f7576","name":"iceberg","contact":{},"location":{"address":"Land ship mall","crossStreet":"Mavoor road","lat":11.25932645611658,"lng":75.77995490718878,"distance":80,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d1c9941735","name":"Ice Cream Shop","pluralName":"Ice Cream Shops","shortName":"Ice Cream","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/icecream_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":5,"usersCount":5,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"50daefa0e4b0ce6f80dddeff","name":"KFC","contact":{},"location":{"lat":11.257809755419688,"lng":75.78060205011138,"distance":107,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4d4ae6fc7a7b7dea34424761","name":"Fried Chicken Joint","pluralName":"Fried Chicken Joints","shortName":"Fried Chicken","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/friedchicken_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":7,"usersCount":7,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"5296fa4a498e02ea46ee7438","name":"ISTP","contact":{},"location":{"lat":11.259023,"lng":75.780433,"distance":30,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d124941735","name":"Office","pluralName":"Offices","shortName":"Office","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":6,"usersCount":1,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4d380ede803ba35d512898fc","name":"Hotel Top Form","contact":{},"location":{"address":"Opposite KSRTC Bus Stand","crossStreet":"Mavoor Road","lat":11.258425121582624,"lng":75.78210353851318,"distance":188,"postalCode":"673004","cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d10f941735","name":"Indian Restaurant","pluralName":"Indian Restaurants","shortName":"Indian","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/indian_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":93,"usersCount":46,"tipCount":2},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"506d5a88e4b08206c603ad36","name":"Seema Towers","contact":{},"location":{"address":"Mavoor Road Junction","lat":11.258742332458496,"lng":75.78060150146484,"distance":20,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d130941735","name":"Building","pluralName":"Buildings","shortName":"Building","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":2,"usersCount":1,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4b7076b5f964a520021c2de3","name":"Kozhikode","contact":{},"location":{"address":"Kozhkode","crossStreet":"Kozhikode","lat":11.258728111538751,"lng":75.78423507888425,"distance":417,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d1f6931735","name":"General Travel","pluralName":"General Travel","shortName":"Travel","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/travel\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":408,"usersCount":154,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4ffc5068e4b0f784b8a336d2","name":"Topform","contact":{},"location":{"address":"Mavoor Road","crossStreet":"Opp KSRTC Bus Station","lat":11.259024391394611,"lng":75.78207230254803,"distance":183,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[],"verified":false,"stats":{"checkinsCount":33,"usersCount":18,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"506d5b0ee4b0b0397364afc2","name":"Seema Towers","contact":{},"location":{"address":"Mavoor Road","crossStreet":"Junction","lat":11.258676528930664,"lng":75.7806625366211,"distance":28,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d130941735","name":"Building","pluralName":"Buildings","shortName":"Building","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":3,"usersCount":2,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4bd80d9809ecb71328f6477c","name":"Chick King Mavoor Road","contact":{"twitter":"chickingglobal"},"location":{"lat":11.258593479558789,"lng":75.78019380569458,"distance":29,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4d4ae6fc7a7b7dea34424761","name":"Fried Chicken Joint","pluralName":"Fried Chicken Joints","shortName":"Fried Chicken","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/friedchicken_","suffix":".png"},"primary":true}],"verified":true,"stats":{"checkinsCount":64,"usersCount":21,"tipCount":1},"url":"http:\/\/chickingindia.in","specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"storeId":"","referralId":"v-1395377160"},{"id":"4e8c31f7d22db1c42b23394e","name":"Thomas Cook","contact":{},"location":{"lat":11.259018701910897,"lng":75.78039768950438,"distance":29,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4d4b7105d754a06375d81259","name":"Professional & Other Places","pluralName":"Professional & Other Places","shortName":"Professional","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":13,"usersCount":8,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"5083e907e4b0ba1a32517a8d","name":"sree theatre","contact":{},"location":{"lat":11.258712886520483,"lng":75.78254913793394,"distance":233,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d17f941735","name":"Movie Theater","pluralName":"Movie Theaters","shortName":"Movie Theater","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/arts_entertainment\/movietheater_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":31,"usersCount":25,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"511f7ab7e4b0293c709a5a9e","name":"Regal Cakes","contact":{},"location":{"lat":11.258030658961067,"lng":75.78061340346989,"distance":83,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d16a941735","name":"Bakery","pluralName":"Bakeries","shortName":"Bakery","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/bakery_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":5,"usersCount":5,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"51fa5ad3498e8a5a78220481","name":"Samsung Service centre","contact":{},"location":{"address":"Lanship Mall","lat":11.259926795959473,"lng":75.78023529052734,"distance":132,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4f04afc02fb6e1c99f3db0bc","name":"Mobile Phone Shop","pluralName":"Mobile Phone Shops","shortName":"Mobile Phone","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/mobilephoneshop_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":2,"usersCount":2,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"51bf06d6498e013b34cb1f77","name":"Sunny Diamonds Calicut","contact":{},"location":{"address":"Mavoor Road","lat":11.258648546129269,"lng":75.78077802706704,"distance":41,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d111951735","name":"Jewelry Store","pluralName":"Jewelry Stores","shortName":"Jewelry","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/jewelry_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":3,"usersCount":3,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4d9c44837ca6a35db1dd7355","name":"Kairali Theatre","contact":{},"location":{"address":"Mavoor Road","crossStreet":"Opp KSRTC","lat":11.25876873393199,"lng":75.782594550745,"distance":238,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d17f941735","name":"Movie Theater","pluralName":"Movie Theaters","shortName":"Movie Theater","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/arts_entertainment\/movietheater_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":144,"usersCount":65,"tipCount":4},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"52e26892498e858e0a96d1a5","name":"G K cool bar","contact":{},"location":{"lat":11.259726647193744,"lng":75.78074964370172,"distance":114,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d112941735","name":"Juice Bar","pluralName":"Juice Bars","shortName":"Juice Bar","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/juicebar_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":2,"usersCount":1,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4dd493281f6ec4e0bb7df0ec","name":"Hotel Sagar","contact":{},"location":{"address":"Mavoor Rd","lat":11.259054622041496,"lng":75.78167706727982,"distance":142,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d10f941735","name":"Indian Restaurant","pluralName":"Indian Restaurants","shortName":"Indian","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/indian_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":56,"usersCount":38,"tipCount":5},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"5031f88ae4b06ef10f10437e","name":"KINGSWAY","contact":{},"location":{"address":"Mavoor road","lat":11.258937636566808,"lng":75.78084047045095,"distance":51,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d130941735","name":"Building","pluralName":"Buildings","shortName":"Building","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":4,"usersCount":1,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"51d56de1498ea03f1f5d0ca4","name":"jassvis digital Color Lab & Studio","contact":{"phone":"+914952368796","formattedPhone":"+91 495 236 8796"},"location":{"address":"Kashkand Chambers","crossStreet":"Bank Road","lat":11.259803771972656,"lng":75.7801742553711,"distance":119,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4eb1bdde3b7b55596b4a7490","name":"Photography Lab","pluralName":"Photography Labs","shortName":"Photography Lab","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/photographylab_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":2,"usersCount":1,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4fb33952e4b0a07cee15dde9","name":"Konica Photo Express","contact":{},"location":{"lat":11.258443832397461,"lng":75.7807846069336,"distance":53,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4eb1bdde3b7b55596b4a7490","name":"Photography Lab","pluralName":"Photography Labs","shortName":"Photography Lab","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/photographylab_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":6,"usersCount":3,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"5076604ee4b0ccc5b2ae6e9c","name":"SBT Calicut","contact":{},"location":{"address":"Kannur Road","crossStreet":"Opp. KTC Honda","lat":11.258255398551059,"lng":75.77828594615717,"distance":238,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d10a951735","name":"Bank","pluralName":"Banks","shortName":"Bank","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/financial_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":9,"usersCount":6,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4d28130f888af04dfb86c2af","name":"Kairali Theatre","contact":{},"location":{"address":"Mavoor Road","lat":11.25899674587286,"lng":75.78250372510846,"distance":230,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d17f941735","name":"Movie Theater","pluralName":"Movie Theaters","shortName":"Movie Theater","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/arts_entertainment\/movietheater_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":26,"usersCount":16,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"50829c5fe4b059457b119efe","name":"Chest Hospital","contact":{},"location":{"lat":11.257112436693024,"lng":75.78063611018419,"distance":184,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d196941735","name":"Hospital","pluralName":"Hospitals","shortName":"Hospital","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/medical_hospital_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":6,"usersCount":4,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4fc369b5e4b07c20ea7b6a8b","name":"Etihad Airways","contact":{},"location":{"lat":11.259284019470215,"lng":75.78036499023438,"distance":59,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d1f6931735","name":"General Travel","pluralName":"General Travel","shortName":"Travel","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/travel\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":6,"usersCount":4,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4f8f8038e4b0c387d4a5fa5d","name":"Thiruvannur Temple Pond","contact":{},"location":{"lat":11.259355543417287,"lng":75.7804431029978,"distance":67,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d15e941735","name":"Pool","pluralName":"Pools","shortName":"Pool","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/parks_outdoors\/pool_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":17,"usersCount":9,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"51604200e4b024efa6241e78","name":"sarbath kada","contact":{},"location":{"address":"Kannur Road","crossStreet":"Under C.H Overbridge","lat":11.256613909069925,"lng":75.77844489566465,"distance":320,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d120951735","name":"Food Court","pluralName":"Food Courts","shortName":"Food Court","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/food_foodcourt_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":8,"usersCount":8,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"5000278ae4b049e4abb65fd5","name":"Dxb","contact":{},"location":{"lat":11.258172704626334,"lng":75.78003914590747,"distance":76,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4f04afc02fb6e1c99f3db0bc","name":"Mobile Phone Shop","pluralName":"Mobile Phone Shops","shortName":"Mobile Phone","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/mobilephoneshop_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":1,"usersCount":1,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4e81b10f775b16f4798ea69b","name":"bata","contact":{},"location":{"crossStreet":"palayam","lat":11.259438482331458,"lng":75.78044128468439,"distance":76,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[],"verified":false,"stats":{"checkinsCount":6,"usersCount":4,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4f642b73e4b045fbd37e7f7d","name":"Bhaskar's Sharbat Shop","contact":{},"location":{"address":"Kannur Rd.","crossStreet":"Nr. CH Flyover","lat":11.256604432352063,"lng":75.77813835002802,"distance":344,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d112941735","name":"Juice Bar","pluralName":"Juice Bars","shortName":"Juice Bar","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/juicebar_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":66,"usersCount":28,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4eae841293ad7677a972ada3","name":"Poonoor","contact":{},"location":{"lat":11.258429680362045,"lng":75.78105050708788,"distance":78,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d15f941735","name":"Field","pluralName":"Fields","shortName":"Field","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/parks_outdoors\/field_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":9,"usersCount":5,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4fae661ce4b01d7a9004918d","name":"Nokia Care","contact":{"phone":"+914953043133","formattedPhone":"+91 495 304 3133"},"location":{"address":"1st Floor","crossStreet":"Lan Ship Mall","lat":11.257894624281441,"lng":75.78059069675197,"distance":97,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4f04afc02fb6e1c99f3db0bc","name":"Mobile Phone Shop","pluralName":"Mobile Phone Shops","shortName":"Mobile Phone","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/mobilephoneshop_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":8,"usersCount":5,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"504f49bce4b0b95082c4cbd8","name":"Techsys","contact":{},"location":{"address":"Lanship Mall","crossStreet":"Bank Road","lat":11.25937638888889,"lng":75.78000833333333,"distance":82,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d125941735","name":"Tech Startup","pluralName":"Tech Startups","shortName":"Tech Startup","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/technology_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":1,"usersCount":1,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"51d521bf498e19413f0f74f4","name":"United India Insurance Co.LTD","contact":{},"location":{"lat":11.258668899536133,"lng":75.78121185302734,"distance":88,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"503287a291d4c4b30a586d65","name":"Financial or Legal Service","pluralName":"Financial or Legal Services","shortName":"Financial \/ Legal","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/financial_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":2,"usersCount":2,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"50e6c51fe4b0092c6d1388ce","name":"Hotel Jinan","contact":{},"location":{"lat":11.258904217649036,"lng":75.7822653075384,"distance":203,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d10f941735","name":"Indian Restaurant","pluralName":"Indian Restaurants","shortName":"Indian","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/food\/indian_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":9,"usersCount":7,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4fe6c823e4b0d55eff5bfbc1","name":"National Hospital","contact":{},"location":{"lat":11.259936439956475,"lng":75.78140245968072,"distance":170,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d196941735","name":"Hospital","pluralName":"Hospitals","shortName":"Hospital","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/medical_hospital_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":10,"usersCount":8,"tipCount":1},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"4f619cd5e4b0bedb2a2dd2a5","name":"Gulf Bazar","contact":{},"location":{"address":"Bank Road","crossStreet":"Opp Dubai Bazar","lat":11.256599828110232,"lng":75.78060205011138,"distance":240,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d130941735","name":"Building","pluralName":"Buildings","shortName":"Building","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/default_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":18,"usersCount":12,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"5159267be4b0172c3cd4df69","name":"Asoka Hospital","contact":{},"location":{"address":"Bank Road","lat":11.2578592300415,"lng":75.78089141845703,"distance":112,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d196941735","name":"Hospital","pluralName":"Hospitals","shortName":"Hospital","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/building\/medical_hospital_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":2,"usersCount":1,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"},{"id":"50efb1e2e4b04f50ee0c399a","name":"Kumari Banana Chips","contact":{},"location":{"lat":11.256672859191895,"lng":75.7783203125,"distance":325,"cc":"IN","city":"Kozhikode","state":"Kerala","country":"India"},"categories":[{"id":"4bf58dd8d48988d1f9941735","name":"Food & Drink Shop","pluralName":"Food & Drink Shops","shortName":"Food & Drink","icon":{"prefix":"https:\/\/ss1.4sqi.net\/img\/categories_v2\/shops\/foodanddrink_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":3,"usersCount":3,"tipCount":0},"specials":{"count":0,"items":[]},"hereNow":{"count":0,"groups":[]},"referralId":"v-1395377160"}],"confident":true}}"

And i tried this but its giving Trying to get property of non-object error ,

我试过了,但它给出了非对象误差的性质,

  $jsonurl = "http://api.foursquare.com/v2/venues/search?client_id=$client_key&client_secret=$client_secret&v=20130815&ll=" . $lat . "," . $lng . "&limit=100";

    $newUrl = htmlspecialchars_decode($jsonurl);
    $json = file_get_contents($newUrl, 0, null, null);
    $json_output = json_encode($json, true);
    $json_output = $venues = stripslashes($json_output);
foreach ($json_output->response->venues as $items) {
        echo "{$items->name}\n";
    }

here is what i have tried : Fiddle

这是我试过的:小提琴

1 个解决方案

#1


1  

You have two problems on your code...

你的代码有两个问题……

1.

The first problem is ...

第一个问题是……

$json_output = json_encode($json, true);
               ^^^^^^^^^^^ //<--- Must be json_decode

You should be decoding it , instead of encoding it.

你应该解码它,而不是编码它。

2.

Remove the true attribute from the above line, because in the below foreach you are accessing it as object.

从上面一行删除true属性,因为在下面的foreach中,您将它作为对象访问。

The right way is

正确的方式是

$json_output = json_decode($json);

#1


1  

You have two problems on your code...

你的代码有两个问题……

1.

The first problem is ...

第一个问题是……

$json_output = json_encode($json, true);
               ^^^^^^^^^^^ //<--- Must be json_decode

You should be decoding it , instead of encoding it.

你应该解码它,而不是编码它。

2.

Remove the true attribute from the above line, because in the below foreach you are accessing it as object.

从上面一行删除true属性,因为在下面的foreach中,您将它作为对象访问。

The right way is

正确的方式是

$json_output = json_decode($json);