* Thus wrote Dale Hersh ([EMAIL PROTECTED]):
> I have a question regarding the count function. Here goes:
> 
> Lets pretend I have this array called myStuff. If I add two elements to
> myStuff and call the count function, I will get a result of 2. My question
> is how do I re-initialize the array after adding elements so when I call the
> count function on the array, I get a result of 0.


unset($myStuff);
or
$myStuff = array();


I usually prefer the empty array method vs. using unset for coding
things like:

$arr = array();
func_to_mod_array($arr);

foreach($arr as $key => val) {
  //....
}

If I used the unset function I'd have to check to see if the
variable is set or not.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to