How can I echo an array of variables with commas + 'ands' where appropriate? For example, say there is an array of artist names such as:
bob, mary, john
how can I have php make use of commas and 'and' when displaying these? 'artists' array may only have one artist in which case I'd want it on it's own:
bob
if there are two variables then 'and' should be used:
bob and mary
but if there are three (or more) artists, commas and 'and' are needed:
bob, mary and john
Is there any way of doing this without having a switch of ifelse statement for each possible number of artists?
Thanks and bye
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --