title: How to get specific part of url?
body: <p>I am working on search function which I want make my search more easier and I had store href inside my db. Therefore, I need to get specific part of current page url <strong>eg :</strong> <code>abc.php</code>.
  But now I only can get full url which is <strong>eg :</strong> <code>http://abc_system/user/abc.php</code>. Is it one of the solution is used <code>substring</code>?I am looking for some help. Hope you guys can help me out. Thanks in advanced.</p>
  
  <p>This is my code which return url result:</p>
  
  <pre><code>function curPageURL() {
   $pageURL = 'http';
   if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
   $pageURL .= "://";
   if ($_SERVER["SERVER_PORT"] != "80") {
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
   } else {
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
   }
   return $pageURL;
  }
  </code></pre>