Display current category name
<p>Thanks in advance.</p>

<p>I am trying to display the name of the current category which I'm in. Nothing that I've been trying for 4 hours now has worked..</p>

<p>My code:</p>

<pre><code>if($catList) {
    $c = 0;

    while($category = $catList-&gt;fetch(PDO::FETCH_ASSOC)){
        $margintop = 38*$c;

        if($category['id'] == $thiscategory) {
            echo "&lt;a href='".$link."&amp;amp;category=".$category['id']."'&gt;
                &lt;div class='category_name'&gt;".strip_tags($category['name']). "&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;";
        } else {
            echo "&lt;a href='".$link."&amp;amp;category=".$category['id']."'&gt;
                &lt;div class='category_name'&gt;".strip_tags($category['name']). "&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;";
        }
        $c++;
    }   
} else {
    echo "No categories to show.";
}
</code></pre>

<p>what I've tried to get the current category name, in a different area in the page:</p>

<pre><code>if($category['id'] == $thiscategory) {
    echo ".strip_tags($category[name])." ;
}
</code></pre>

<p>which gives a blank result.</p>