title: First and Last Index of occurrence of value in PHP Array
body: <p>I have an array created in PHP as follows:</p>
  
  <p><em><code>$arr = array(123,144,144,123);</code></em></p>
  
  <p>How do I get the first and last indexes of occurrence of each value.<br />
  Something like,</p>
  
  <pre><code>123 -&gt; first occurrence - 0th index | last occurrence - 3rd index
  144 -&gt; first occurrence - 1st index | last occurrence - 2nd index
  </code></pre>