title: (1.9) Get ID's of all a product's categories (on product page)
body: <p>So this week I managed to break my site by attempting to get the ID of the current category within the product page (catalog/product/view.phtml), using the following code</p>
  
  <pre><code>$category_id = Mage::registry('current_category')-&gt;getId();
  </code></pre>
  
  <p>This actually works fine if you navigate into the product through the generic navigation, but when reaching a product from the front page 'featured products' link, everything falls over - presumably because I'm asking for a category ID when i'm not in a category.</p>
  
  <p>What i'd like to know is how i can fetch an array of IDs of all the categories to which the current product belongs. </p>