I have a for script:
<?php for($i=1; $i<10; $i++):?>
<?php if($this->item->nuotrauka{$i}):?>
<div class="vobsmall">
<img src="<?php echo $this->item->nuotrauka{$i}; ?>"/>
<?php echo $this->item->nuotrauka{$i}; ?>
</div>
<?php endif; ?>
<?php endfor; ?>
There's 9 variables like $this->item->nuotrauka1
, $this->item->nuotrauka2
etc.
As you can see here I'm trying to call these variables using {i}
as number of object variable. Hovewer the code above returns single char from variable and not full variable as I want. How should I write {i}
here to get what I want ?