I have an array and I need to clear it. I would rather not zero out all of the values, but rather purge the entire array and start over each time the function is called. The problem is that I have got to keep the Global array.
I know I can use a for loop like the following but I would rather save the time if possible.
<?php
$temp=array()
echo"<html><head><title>TEST</title></head><body>";
function zero_array() {
global temp;
echo"Zeroing the Array...<br><br>";
for($i=0; $i<$temp [count ($temp)]; $i++) {
$temp[$i]=0;
}
echo"Array has been zeroed out.<br>";
}
echo"</body></html>";
?>