library/Garp/Util/String.php
static public function humanList(array $list, $decorator = null, $lastItemSeperator = 'and') {
        $listCount = count($list);
        if ($listCount === 1) {
            return $decorator . current($list) . $decorator;
        } elseif ($listCount === 2) {
            return $decorator . implode(
                $decorator . " {$lastItemSeperator} " . $decorator, $list
            ) . $decorator;
        } elseif ($listCount > 2) {
            $last = array_pop($list);
            return $decorator . implode(
                $decorator . ", " . $decorator, $list
            ) . $decorator . " {$lastItemSeperator} " . $decorator . $last . $decorator;
        }
    }
static public function humanList(array $list, $decorator = null, $lastItemSeperator = 'and') {
        $listCount = count($list);
        if ($listCount === 1) {
            return $decorator . current($list) . $decorator;
        } elseif ($listCount === 2) {
            return $decorator . implode(
                $decorator . " {$lastItemSeperator} " . $decorator, $list
            ) . $decorator;
        } elseif ($listCount > 2) {
            $last = array_pop($list);
            return $decorator . implode(
                $decorator . ", " . $decorator, $list
            ) . $decorator . " {$lastItemSeperator} " . $decorator . $last . $decorator;
        }
    }
static public function humanList ( array $ list , $ decorator = null , $ lastItemSeperator = 'and' ) { $ listCount = count ( $ list ) ; if ( $ listCount === 1 ) { return $ decorator . current ( $ list ) . $ decorator ; } elseif ( $ listCount === 2 ) { return $ decorator . implode ( $ decorator . " {$lastItemSeperator} " . $ decorator , $ list ) . $ decorator ; } elseif ( $ listCount > 2 ) { $ last = array_pop ( $ list ) ; return $ decorator . implode ( $ decorator . ", " . $ decorator , $ list ) . $ decorator . " {$lastItemSeperator} " . $ decorator . $ last . $ decorator ; } }
Creates a human-readable string of an array.

@param array $list Numeric Array of String elements,
@param string $decorator Element decorator, f.i. a quote.
@param string $lastItemSeperator Seperates the last item from the rest instead of a comma,
for instance: 'and' or 'or'.
@return string Listed elements, like "Snoop, Dre and Devin".
Creates a human - readable string of an array .