Page 1 of 1

Simple array question

Posted: Mon Jan 26, 2004 1:14 pm
by pickle
Hi all,

I was wondering if there's an easy way to empty an array. I've got an array already full of values, and I want to remove all index/value associations so the array becomes empty. Due to the type flexibility in PHP, I've managed to do a workaround by just setting the array to = ''. I know it's extremely ugly, but that's why I'm posing the question here. Thanks in advance for any help/suggestions.

Posted: Mon Jan 26, 2004 1:16 pm
by markl999
unset($array);

Posted: Mon Jan 26, 2004 2:25 pm
by pickle
Yep, that did it. Thanks.