public static function oxford(array $items, $conjunction = 'and') {
    $count = count($items);

    if ($count < 2) {
      return (string) reset($items);
    }
    elseif ($count === 2) {
      return reset($items) . ' ' . $conjunction . ' ' . end($items);
    }
    else {
      $items[] = $conjunction . ' ' . array_pop($items);
      return implode(', ', $items);
    }
  }
public static function oxford(array $items, $conjunction = 'and') {
    $count = count($items);

    if ($count < 2) {
      return (string) reset($items);
    }
    elseif ($count === 2) {
      return reset($items) . ' ' . $conjunction . ' ' . end($items);
    }
    else {
      $items[] = $conjunction . ' ' . array_pop($items);
      return implode(', ', $items);
    }
  }
public static function oxford ( array $ items , $ conjunction = 'and' ) { $ count = count ( $ items ) ; if ( $ count < 2 ) { return ( string ) reset ( $ items ) ; } elseif ( $ count === 2 ) { return reset ( $ items ) . ' ' . $ conjunction . ' ' . end ( $ items ) ; } else { $ items [ ] = $ conjunction . ' ' . array_pop ( $ items ) ; return implode ( ', ' , $ items ) ; } }
Formats a set of strings with an Oxford comma.

@param string[] $items
The set of strings to format.
@param string $conjunction
(optional) The translated conjunction to insert before the final item.
Defaults to 'and'.

@return string
The single Oxford-ized string.
Formats a set of strings with an Oxford comma .