Agoraphobia, or the anxiety from wide spaces, is really interesting. 
Oh really?  What is interesting about it?
Well it is where the person perceives the environment to be unsafe with no simple way to get away from it.
When you say "the environment" do you mean like in the forest or nature or that kind of thing?  Or just outside?
Any environment, whether its outside or inside. As long as it seems unsafe for them.
So then how do they function in society?  You're basically telling me that they don't go outside at all, right?
They do go outside, but it just has risks involved, like panic attacks.