title: How to group an array containing strings?
body: <p>I have an array which contains strings and I need to group them accordingly. Please advise.</p>
  
  <pre><code>Array ( 
    [0] =&gt; string1 
    [1] =&gt; string1 
    [2] =&gt; string2 
    [3] =&gt; string2 
    [4] =&gt; string3 
    [5] =&gt; string1  
        ) 
  </code></pre>
  
  <p>I need the output as follows:</p>
  
  <blockquote>
    <p><code>string1</code><br>
    <code>string2</code><br>
    <code>string3</code></p>
  </blockquote>
  
  <p>How can I achieve this?</p>