You can use basic ASCII Text editors to write PHP code. You simply need to save the file with the .php extension.
To learn PHP you’ll need a LAMP server of some sort, a text editor, and a good study guide. I highly recommend buying a book because it’s an excellent UI while learning a language.
The sort() and sort() functions allow you to sort arrays alphabetically.