after add value into the array, how to make array empty.
Try the unset function:
http://www.php.net/manual/en/function.unset.php
The documentation shows it deleting a single array value in the example. You can just iterate through the array and unset each element.
HTH,
Joseph
thanks, probably you are right. I have done it by using array_pop().
cheers
I don't know, but maybe the simpliest way is: $non_empty_array = array();