hmmm...
Im looking at your code again and might have the solution.
Everytime you call the function, you are declaring a static variable and setting it to an empty array. So it is infact static, but its being emptied by a "new" array each time.
Try something like this
Code:
<?php
function myfunc($num)
{
static $myarray;
if ( is_null($myarray) )
$my_array = new array();
// ..... Rest of code
}
Something along those lines should do it... I didnt catch that on the first post. This way, the array is only null when you define it (with the static keyword) and when you add values to it, is_null will return false and it wont be re-declared; thus wont be set to an empty array.
Sounds like I repeated myself there a few times, but you get the idea
Hope this helps!
Will