How to Display Category Based on ID In PHP

Suppose We Have 3 Types of categories. We have to Display the category Based on ID. using the if else statement we can display like..

<?php

if($post['category_id'] == '1')

{ echo "Category One"; }

else

{ echo "Category Two "; }

?>

Sign In or Register to comment.