src/Titon/Utility/Str.php
public static function listing($items, $glue = ' &amp; ', $sep = ', ') {
        if (is_array($items)) {
            $lastItem = array_pop($items);

            if (count($items) === 0) {
                return $lastItem;
            }

            $items = implode($sep, $items);
            $items = $items . $glue . $lastItem;
        }

        return $items;
    }
public static function listing($items, $glue = ' &amp; ', $sep = ', ') {
        if (is_array($items)) {
            $lastItem = array_pop($items);

            if (count($items) === 0) {
                return $lastItem;
            }

            $items = implode($sep, $items);
            $items = $items . $glue . $lastItem;
        }

        return $items;
    }
public static function listing ( $ items , $ glue = ' &amp; ' , $ sep = ', ' ) { if ( is_array ( $ items ) ) { $ lastItem = array_pop ( $ items ) ; if ( count ( $ items ) === 0 ) { return $ lastItem ; } $ items = implode ( $ sep , $ items ) ; $ items = $ items . $ glue . $ lastItem ; } return $ items ; }
Creates a comma separated list with the last item having an ampersand prefixing it.

@param array $items
@param string $glue
@param string $sep
@return string
Creates a comma separated list with the last item having an ampersand prefixing it .