title: getting file name with regular expression php
body: <p>I'am trying to use regular expression to get just file name from URL for example:</p>
  
  <pre><code>$link = "http://localhost/website/index.php";
  
  $pattern = '/.*?\.php';
  
  preg_match($pattern, $link, $matches);
  </code></pre>
  
  <p>but it returns "<code>//localhost/website/index.php</code>" instead of "<code>index</code>".</p>