Creating a text list of online users is simple enough. You can simply append their name to the end of the text file everytime someone logs on. The problem is removing them from the online list when they log out of your site.
If they have a logout button which removes them from the online list, all is well, but if they close the browser without logging out, you will not be able to update your list and it will be useless.
Check the manual for info on sessions I think this will better suit your needs.