public static function implode($delim, array $arr, $beforeLast = null): string
    {
        if (count($arr) > 1 && $beforeLast !== null) {
            $arr[] = $beforeLast.array_pop($arr);
        }
        return implode($delim, $arr);
    }
public static function implode($delim, array $arr, $beforeLast = null): string
    {
        if (count($arr) > 1 && $beforeLast !== null) {
            $arr[] = $beforeLast.array_pop($arr);
        }
        return implode($delim, $arr);
    }
public static function implode ( $ delim , array $ arr , $ beforeLast = null ) : string { if ( count ( $ arr ) > 1 && $ beforeLast !== null ) { $ arr [ ] = $ beforeLast . array_pop ( $ arr ) ; } return implode ( $ delim , $ arr ) ; }
Implode values with a defferent delimeter before the last element

@param string $delim The delimeter
@param array $arr The array to implode
@param string|null $beforeLast A string to prepend to the last element
@return string
Implode values with a defferent delimeter before the last element