title: Check if string contains a value in array
body: <p>I am trying to detect whether a string contains at least one URL that is stored in an array.</p>
  
  <p>Here is my array:</p>
  
  <pre><code>$owned_urls = array('website1.com', 'website2.com', 'website3.com');
  </code></pre>
  
  <p>The string is entered by the user and submitted via PHP. On the confirmation page I would like to check if the URL entered is in the array.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>$string = 'my domain name is website3.com';
  if (in_array($string, $owned_urls))
  {
      echo "Match found"; 
      return true;
  }
  else
  {
      echo "Match not found";
      return false;
  }
  </code></pre>
  
  <p>No matter what is inputted the return is always "Match not found".</p>
  
  <p>Is this the correct way of doing things?</p>