As pointed out by lyklev below, $label[0] can be empty.
In reply to Re^3: How to Fetch Gmail by ww in thread How to Fetch Gmail by lalitbans