I am in need to open a text file (file.txt) which contains data in the following format
ai bt bt gh ai gh lo ki ki lo
ultimately I want to remo
Take the php function file() to read the file. You get an array of lines from your file. After that, take array_unique to kick out the duplicates.
In the end, you will have something like
$lines = array_unique(file("your_file.txt"));