msky
10-17-2009, 08:34 PM
PHP newbie. I'm using this code
<li class="amenities"><u>Amenities</u> (may vary by season):
<?php
foreach((get_the_category_excludeCat()) as $cat) {
if (!($cat->cat_name=='')) echo $cat->cat_name . ', ';
}
?></li>
to print this:
Amenities (may vary by season): fireplace, jacuzzi/hot tub, kitchen/kitchenette, pets allowed, smoke free, waterfront,
How do I stop the final comma from printing?
thanks
<li class="amenities"><u>Amenities</u> (may vary by season):
<?php
foreach((get_the_category_excludeCat()) as $cat) {
if (!($cat->cat_name=='')) echo $cat->cat_name . ', ';
}
?></li>
to print this:
Amenities (may vary by season): fireplace, jacuzzi/hot tub, kitchen/kitchenette, pets allowed, smoke free, waterfront,
How do I stop the final comma from printing?
thanks