Last updated: Mon, Apr 17, 2023 1:13 pm
Return to Knowledgebase
# | Parameter | Data Type | Required | Description |
---|---|---|---|---|
1 | $data | array | Yes | an array of strings representing the items in the list |
2 | $opts = [] | array | No | an optional array of options. The only option currently supported is final, which is a string to use as the final conjunction in the list (e.g. "and" or "or"). |
Data Type | Description of Returned Data |
---|---|
string | A string that is a grammatically correct list of the items in the array. |
$myArray = array("apple", "banana", "orange");
$options = array("final" => "or");
echo oxfordList($myArray, $options); // Output: "apple, banana, or orange"