title: How to print or echo the array index of in PHP
body: <p>I'm trying to complete my assignment and this is the last thing to do now.</p>
  
  <p>I know if I want to print the whole array I can just use <code>foreach</code> and many different method to print the entire array</p>
  
  <pre><code>foreach($v as $k=&gt;$variable_name) { echo "&lt;p&gt; This is index of $k. value is $variable_name &lt;br/&gt;&lt;/p&gt;";}
  </code></pre>
  
  <p>But what if I want to only print each index separately? </p>
  
  <p>I want to do the error message under each form so that is why I want each of them separate.</p>
  
  <p>I tried with <code>$v[0]</code> and nothing appear. </p>
  
  <p>is there a trick or something am I missing?</p>