title: How to check values inside foreach loop are same or not
body: <p>i have a foreach loop as</p>
  <pre><code>foreach ($age as $ages) {
     echo $ages;
  }
  </code></pre>
  <p>when run this code the result is</p>
  <pre><code>3
  3
  </code></pre>
  <p>or</p>
  <pre><code>1
  3
  </code></pre>
  <p>i want to check if values are same or not. For example</p>
  <pre><code>if (values are same) {
    do something...
  }
  else {
    do something...
  }
  </code></pre>
  <p>i really couldn't find how to check values are same or not.</p>