I think the simpliest way would be to check for the size, use ifs/case to check if its one, two or three or more. then for 3 or more. loop through the array and print it with commas until you get to the item in the array with an index that is two less then the size. then use an and.
something like:
PHP Code:
if(sizeof($artists) >=3){
for($i ==0; $i < sizeof($artists); $i++){
if($i < sizeof($artists) - 2){
echo $artists[$i] . ", ";
}
else if($i == sizeof($artists) - 2){
echo $artists[$i] . " and ";
}
else{
echo $artists[$i];
}
}
i didn't test this so there is probably some missing semi colans and such but it should give you the general idea.
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --