I am pretty new to PHP and altho I am ratehr good with linux and shell I was wondering if there is an easier different and maybe more efficient way of doing what I would like to do with a PHP script ?
I know how to cat and sort text and contents of a file in shell / linux but was wondering is there a way to do so in PHP ?
Example
if I have a text file that has the contents
hello
hello
hello
Night
Night
Night
Daytime
Daytime
Daytime
clock
clock
clock
ETC ETC ETC how would I read and then create a new file with only one copy of each in the file
hello
Night
Daytime
clock
ETC ETC ...
Please let me know and also if possible can someone direct me to a site that I may learn more about this in PHP
Thanks