Punic\Misc classΒΆ

Use the misc class to join a list of numbers correctly into a single string.

use Punic\Misc;

echo Misc::joinUnits(array('1 yd', '1 ft', '3 in'), '', 'en');
// Output: 1 yd, 1 ft, 3 in

echo Misc::joinUnits(array('1 yd', '1 ft', '3 in'), '', 'de');
// Output: 1 yd, 1 ft und 3 in

echo Misc::joinAnd(array('One', 'two', 'three'), '', 'en');
// Output: One, two, and three

echo Misc::joinAnd(array('Eins', 'Zwei', 'Drei'), '', 'de');
// Output: Eins, Zwei und Drei

echo Misc::joinOr(array('One', 'two', 'three'), '', 'en');
// Output: One, two, or three

echo Misc::joinOr(array('Eins', 'Zwei', 'Drei'), '', 'de');
// Output: Eins, Zwei oder Drei