php - from facebook, i want to fetch Hometown details . from it i want to saparate city,state, country -
from facebook, want fetch hometown details . want separate city,state, country. these fields separated comma. can split them comma. my problem is: enter city name in hometown field of facebook, giving combination of city,state , country. sometime giving combination of city , country so, when split string comma, how know second element state or country. i can 1 thing, can check length of array, if has 3 filed has city/state/county. else city/county. is ture? can have more files. just query fql user table: select hometown_location user uid=me() this return like: [ { "hometown_location": { "city": "xxxxx", "state": "xxxxx", "country": "xxxx", "zip": "xxxxx", "id": xxxx, "name": "xxx, xxx, xxxxx" } } ] of course of fields empty if user didn't set them. (result set returned using fql.query t...