"ppphhhtttt...
This is easy"
lol.. don't be so smug, because the code you post makes no sense at all. There is even a syntax error in it.
The IF statements that you find so easy, will return true for any content of $file(yes I tested it, maybe you should to). Even if you put three thousand commas in it, the 'tab' IF still returns true.