Want to display custom taxanomy term without link

I am not familiar with coding.
I have two php codes, both work well but I not understand difference between them.

first code –

<?php $terms_as_text = get_the_term_list( $post->ID,’qcolor’, ‘ ‘ ); if (!empty($terms_as_text)) echo ”, strip_tags($terms_as_text) ,”; ?>

second code-

<?php $terms_as_text = get_the_term_list( $post->ID,’qcolor’, ‘ ‘ ); if (!empty($terms_as_text)) echo strip_tags($terms_as_text) ,”; ?>

I got a third code on stackexchange

<?php echo strip_tags(get_the_term_list( $post->ID, ‘qcolor’, ‘ ‘,’, ‘)); ?>

can anybody help me to find out which is more correct and well coded.

Read more here:: Want to display custom taxanomy term without link

Leave a Reply

Your email address will not be published. Required fields are marked *