public static function implodeIgnoringBlanks($glue, $array, $itemCallback = null, $keysToInclude = null)
    {
        $array = array_filter($array);

        if (!empty($itemCallback)) {
            foreach ($array as $key => $value) {
                $array[$key] = $itemCallback($value);
            }
        }

        $keys = [$keysToInclude];

        for ($i = 4; $i < func_num_args(); $i++) {
            $keys[] = func_get_arg($i);
        }

        $keys = array_filter($keys);

        $string = "";

        if (count($keys)) {
            foreach ($keys as $key) {
                if (!empty($array[$key])) {
                    $string .= $array[$key] . $glue;
                }
            }
            if (strlen($string) >= strlen($glue)) {
                $string = substr($string, 0, strlen($string) - strlen($glue));
            }
        } else {
            $string = implode($glue, $array);
        }

        return $string;
    }