A more elegant solution to this would be to create a database table and insert each IP address into a mySQL table.