1//To clear array you are able to simply re-instantiate it
2$foo = array();
3
4//To clear $foo from the symbol table use
5unset($foo);
1$arr = array();
2
3if(!empty($arr)){
4 echo "not empty";
5}
6else
7{
8 echo "empty";
9}
10
1$colors = array("red","","blue",NULL);
2
3$colorsNoEmptyOrNull = array_filter($colors, function($v){
4 return !is_null($v) && $v !== '';
5});
6//$colorsNoEmptyOrNull is now ["red","blue"]