title: Magento - Accessing values from an Mage_Catalog_Model_Resource_Product_Collection object
body: <p>I am new to magento and php and I am trying to retrieve values from an object.</p>
  
  <pre><code>$_productCollection=$this-&gt;getLoadedProductCollection();
  </code></pre>
  
  <p>When I do a <code>print_r()</code> I am getting something like below</p>
  
  <pre><code>Mage_Catalog_Model_Resource_Product_Collection Object
  (
      [_flatEnabled:protected] =&gt; Array
          (
              [1] =&gt; 
          )
  
      [_productWebsiteTable:protected] =&gt; sn_catalog_product_website
      [_productCategoryTable:protected] =&gt; sn_catalog_category_product
      [_addUrlRewrite:protected] =&gt; 1
      [_urlRewriteCategory:protected] =&gt; 3
      [_addMinimalPrice:protected] =&gt; 
      [_addFinalPrice:protected] =&gt; 
      [_allIdsCache:protected] =&gt; 
      [_addTaxPercents:protected] =&gt; 1
      [_productLimitationFilters:protected] =&gt; Array
          (
              [category_id] =&gt; 3
              [category_is_anchor] =&gt; 1
              [store_id] =&gt; 1
              [use_price_index] =&gt; 1
              [customer_group_id] =&gt; 0
              [website_id] =&gt; 1
              [visibility] =&gt; Array
                  (
                      [0] =&gt; 2
                      [1] =&gt; 4
                  )
  
          )
  )
  </code></pre>
  
  <p>And I need to get the category ID in this.
  Can someone please help me </p>