title: How to detect a URL which has additional text at the end?
body: <p>I am currently designing a website which uses this: <code>&lt;li class="current"&gt;</code>.</p>
  
  <p>I have gotten a script to detect when it's on said page to output the right class, however, when on the gallery.php?dir=thedir page, it fails to output the class!</p>
  
  <p>Here's what I have so far, which is not working...</p>
  
  <pre><code>$ispage = preg_match_all('gallery.php/\[(.+?)\]/s');
  </code></pre>
  
  <p>I would appreciate any information somebody could give me :).</p>
  
  <p>Full code:</p>
  
  <pre><code>&lt;?php 
  $ispage = preg_match_all('gallery.php/\[(.+?)\]/s'); 
  $currentpage = $_SERVER['REQUEST_URI']; 
  if ($ispage==$currentpage) { 
      echo '&lt;li class="current"&gt;'; 
  } else { 
      echo '&lt;li&gt;'; 
  } 
  ?&gt;&lt;a href="gallery.php"&gt;Photos&lt;/a&gt;&lt;/li&gt;
  </code></pre>