title: Why does preg_match_all() create the same answer multiple times?
body: <p>The following code extracts #hashtags from a tweet and puts them in the variable $matches.</p>
  
  <pre><code>$tweet = "this has a #hashtag a  #badhash-tag and a #goodhash_tag";
  
  preg_match_all("/(#\w+)/", $tweet, $matches);
  
  var_dump( $matches );
  </code></pre>
  
  <p>Can someone please explain to me why the following results have <strong>2 identical arrays instead of just 1</strong>?</p>
  
  <pre><code>array(2) {
    [0]=&gt;
    array(3) {
      [0]=&gt;
      string(8) "#hashtag"
      [1]=&gt;
      string(8) "#badhash"
      [2]=&gt;
      string(13) "#goodhash_tag"
    }
    [1]=&gt;
    array(3) {
      [0]=&gt;
      string(8) "#hashtag"
      [1]=&gt;
      string(8) "#badhash"
      [2]=&gt;
      string(13) "#goodhash_tag"
    }
  }
  </code></pre>