title: Smarty current on associative array
body: <p>i have an associative array and i am trying to get the first record with smarty.</p>
  
  <p>In php i use current(array), but smarty dont seems to have current.</p>
  
  <p>So i wrote the code below</p>
  
  <pre><code>{if is_array($browseProducts.data) }
      &lt;ul class="products-grid"&gt;
  
          {foreach from=$browseProducts.data item=item}
              {assign var='image' value=''}
              {if is_array($item.images) }
                  {php} $image=current($item.images); {/php} 
              {/if}   
          {/foreach}
  
      &lt;/ul&gt;
  {/if}
  </code></pre>
  
  <p>in {php} section current($item.images) gives Warning: current() [function.current]: Passed variable is not an array or object</p>
  
  <p>The syntax is right so i guess the $item.images from smarty can not be read by {php}</p>
  
  <p>Any way to pass $item.images to {php} section, or what.</p>
  
  <p>Any suggestion to solve my problem?</p>