You want to unset $dates but I don't see it's definition. If you are trying to unset the array you are currently looping through, then you are asking for trouble.
Please be more specific in your code snippet with what and where you want to do this, so we know the whole scenario. Also, when you say you tried a few things, and it didn't work.. Let us know, why it didn't work: what happened?
diafol
THat doesn't make much sense.
Have a look at array_shift
That returns the first item of an array as it removes it.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.