Sorry forgot the 'next':

foreach($this->many as $one){
echo '1st';
$array = $this->many->toArray();
while($array1 = current($array)){
echo '2nd';
next($array);
}
}


Waigani wrote:
> 
> Here is my work around:
> 
> foreach($this->many as $one){
> echo '1st';
> $array = $this->many->toArray();
> while($array1 = current($array)){
> echo '2nd';
> }
> }
> 
> Cheers,
> 
> 
> 
> Waigani wrote:
>> 
>> can you nest foreach in the framework?
>> 
>> eg in a view template:
>> 
>> foreach($this->many as $one){
>> print_r($one);
>> foreach($this->many as $one){
>> print_r($one);
>> }
>> }
>> 
>> I have tried this, does not seem to work. I see there is a php bug to do
>> with nested foreach and globals: http://bugs.php.net/bug.php?id=26396. Is
>> there anyway around this?
>> 
>> Thanks,
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/nested-foreach-tf4591373s16154.html#a13107374
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to