Reputation: 67
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.
Upvotes: 0
Views: 2349
Reputation: 11
You should reset the array once again.
$arrayNew=reset($arrayOld);
$value=$arrayNew[0];
value will return the first element.
Upvotes: 0