How to get string format link url .html in array using preg_match?
<p>I have a sample code:</p>

<pre><code>$array = array(
   1 =&gt; "tag/gomobi.html", 
   2 =&gt; "game.html", 
   3 =&gt; "game.php", 
   4 =&gt; "game.html", 
   5 =&gt; "game/game-mobile/feed.html"
);
foreach ($array as $url) {
   if(preg_match('/^((.*)\.html)(.*?)$/', $url, $matches)) {
       echo $matches[1].'&lt;br /&gt;';    
   } 
}
</code></pre>

<p>But result can't remove value same (game.html)</p>

<pre><code>tag/gomobi.html
game.html
game.html
game/game-mobile/feed.html
</code></pre>

<p>How to fix it, with result is:</p>

<pre><code>tag/gomobi.html
game.html
game/game-mobile/feed.html
</code></pre>
