[Plugin: Magic Fields] Duplicate field output separated by commas and ampersand
-
This is probably something really obvious, but how do I make it so that the ‘contributor_name’ list in the following code is separated by commas except for the last name in the list, which I want separated by an ampersand?
if(!function_exists('contributor')){ function contributor(){ global $post; $Contributors = get_group('Contributor'); foreach($Contributors as $Contributor){ if( in_array('Artist',array_values($Contributor['contributor_role']) ) ) { echo $Contributor['contributor_name'][1]; } } } }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[Plugin: Magic Fields] Duplicate field output separated by commas and ampersand’ is closed to new replies.