What is the difference between using a loop in PHP Smarty and directly in PHP when outputting arrays?

When outputting arrays in PHP Smarty, you need to use the `{foreach}` loop construct provided by Smarty to iterate over the array elements and display them. This is different from directly using PHP where you would typically use a `foreach` loop to iterate over the array elements and echo them out. The main difference is the syntax and usage of the loop construct.

// Using a loop in PHP Smarty to output an array
{foreach $array as $item}
   {$item}
{/foreach}