I have a list box function that I built in PHP 4. It reads the list box entries from a text file and builds the list box selections based upon that. This way, no coding changes are necessary if the list ever changes -- only the text file need be modified.
This all works fine until I get to the end of the text file. I cannot seem to get the function to ignore null lines. I've tried trapping for "", "\r", "\n", "\r\n" but nothing seems to work. It reads the line anyway and screws up the end of the list by putting a blank entry in the list box. The only fix I have found so far is to make sure that the text file does not contain a CR after the last entry.
This should be an elementary string parsing issue, but it's got me stumped.
Any suggestions anyone?