thanks this was helpful. i was storing some values in a comma separated list and converting it to an array with explode and didn't notice the comma at the end of the list nothing after it was being counted as an element and causing problems until i counted the number of value s in the array.