title: Smarty:- Create an associative array using for loop and check wheather value exists in array
body: <p>i  am new to smarty and a dont know how to Create an associative array using for loop and check wheather value exists.</p>
  
  <p>But i created the array in php and checked value exists.</p>
  
  <p>Can anyone help me to code the same in smarty tpl file</p>
  
  <pre><code>&lt;?php
  $newArray=array();
  for($i=0; $i&lt;=10; $i++){
  $newArray[]=$i;
  }
  if (in_array("5", $newArray)) 
  { 
  echo "found"; 
  } 
  else
  { 
  echo "not found"; 
  } 
  </code></pre>