How to save as text file?

I am New Here.
I am Create Phone book on the Flash 8.
In the Phone Book You can save your phone number and name.
I am save phone number and name in the Local Storage System.
See below.
Link:Phone book.
How to save a phone number and name in to Text file(txt).
I am tried to save as text file through PHP,but it failed.
Please help me.
Thanks anybody help me.