title: Use preg_match to grab value from URL
body: <p>I have a url something like:</p>
  
  <p>www.yourname.mysite.com/templates/diversity/index.php</p>
  
  <p>I need to grab that string, "diversity", and match it against a db value. I've never used anything like preg_match in php, how can I grab that string?</p>