Sorry, what do you mean by this?
It looks like you have posted some PHP code that is mapping variables out of Tweet objects.
Location is optional both in user profile objects and in Tweet object geo attributes, and it is totally down to the user to choose to share their location in either of those two objects.
Only a small percentage of Tweets have geo data associated with them. It is not possible to extract a user location if that information is not actively being shared.