/** * Like end(),return the first element of an array * @author Wilson Zeng */function first($stack){ if(is_array($stack)){ reset($stack); return current($stack); }else{ return $stack; }}