title: Create a php variable from URL without question mark
body: <p>I need to create a variable in PHP from a URL, which does not have a fully formed query string. </p>
  
  <p>e.g. <a href="http://search.domain.com/domain2.com" rel="nofollow noreferrer">http://search.domain.com/domain2.com</a></p>
  
  <p>In this example, the variable needs to be </p>
  
  <pre><code>$website='domain2.com'
  </code></pre>
  
  <p>Is there a way to convert the entered URL in address bar to my ?website=     variable?</p>
  
  <p>An example would be the whois.domaintools service, which allows you to query a whois record from their website using the following url format:</p>
  
  <p><a href="http://whois.domaintools.com/domain.com" rel="nofollow noreferrer">http://whois.domaintools.com/domain.com</a></p>
  
  <p>This then displays info based on the url you specified. </p>
  
  <p>Can i achieve this using a MOD_Rewrite in the .htaccess, or can i use some PHP function like http_build_query to achieve this? I'm going around in circles and surely missing something obvious! </p>