Moinax\TvDb\Client::removeEmptyIndexes PHP Method

removeEmptyIndexes() public static method

Removes indexes from an array if they are zero length after trimming
public static removeEmptyIndexes ( array $array ) : array
$array array The array to remove empty indexes from
return array An array with all empty indexes removed
    public static function removeEmptyIndexes($array)
    {
        $length = count($array);
        for ($i = $length - 1; $i >= 0; $i--) {
            if (trim($array[$i]) == '') {
                unset($array[$i]);
            }
        }
        sort($array);
        return $array;
    }