我想分隔这些由逗号输出的链接,但最后一个链接上没有逗号。实现这一目标的最佳方法是什么?
<p class="favs">Favourite Courses:
<?php
$user_id = bp_get_member_user_id();
$array = get_user_meta($user_id, 'wpfp_favorites', true);
foreach ($array as $key => $value) {
$queried_post = get_post($value); ?>
<a href="http://publicaccessgolf.com.au/<?php echo $queried_post->post_name; ?>" title="<?php echo $queried_post->post_title; ?>" ><?php echo $queried_post->post_title; ?></a>
<?php } ?>
</p>