Rather than use $read() I would suggest using $ini() for checking the existence of a topic in the ini file, it's more suitable:
The thing is, it uses a text file, not an ini file.
I'm not sure if the use of $ini will apply to the text file to match the string inside the brackets.
Perhaps you meant to tell me the use of $ini can mimic the ini format stored in a .txt?