In smarty, how to check whether an associative array is empty or not?

php, smarty

Solution

In Smarty3, you can use PHP's empty() function:

`somefile.php`

<?PHP
$smarty->assign('array',array());
$smarty->display('template.tpl');

`template.tpl`

{if empty($array)}
  Array is empty
{else}
  Array is not not empty
{/if}

Outputs `Array is empty`.

Problem

I done google for it, but couldn't get the correct solution. Can any one help me out to check whether the associative array is empty or not. Thanks in Advance.

Original source