I have associative array:
Array ( [7] => Array ( [media_id] => 7 ) Array ( [8] => Array ( [media_id] => 8 ) Array ( [5] => Array ( [media_id] => 5 ) Array ( [18] => Array ( [media_id] => 18 )
I need to call only the first element with smarty template engine.
Try this:
{$arrayVar|@array_shift}
You should reset the array once again.
$arrayNew=reset($arrayOld);
$value=$arrayNew[0];
value will return the first element.