Empty an array?
Posted: Sat May 15, 2004 4:31 pm
Can't seem to find a function to do this. I want to empty an array completely of all data. I tried unset and empty but neither appear to work. Is there a way to empty an array?!
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
//assuming you have a situation like:
$ar = array(1,2,3,4,5,6);
//empty it with:
$ar = array();Code: Select all
<?
unset($ar[0]);
?>