formatList() public static method

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