Format a list of strings with comma separators and a final 'and'.
public static formatList ( array $items ) : string | ||
$items | array | |
return | string |
/** * Systemic diagnoses shortcode * * @return string */ public function getSyd() { return strtolower(Helper::formatList(Helper::extractValues($this->getSystemicDiagnoses(), 'disorder.term'))); }
public function testFormatList_Three() { $this->assertEquals('foo, bar and baz', Helper::formatList(array('foo', 'bar', 'baz'))); }