Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php variable outside foreach

$categorySize = array();

<?php  $categories = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*'); 
         foreach ($categories as $category): 
         $categorySize = $category->getSize_chart(); 
         print_r ($categorySize); 
         endforeach;
    ?>

print_r($categorySize) //Now you can get it outside the loop 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #variable #foreach
ADD COMMENT
Topic
Name
4+6 =