title: Check if string contains another string
body: <p>In php is there a way i can check if a string includes a value. 
  Say i had a string "this &amp; that", could i check if that included "this".
  Thanks</p>
  
  <p>UPDATED:</p>
  
  <p>$u = username session</p>
  
  <pre><code>function myLeagues2($u)
  {
       $q = "SELECT * FROM ".TBL_FIXTURES." WHERE `home_user` = '$u' GROUP BY `compname` ";
     return mysql_query($q, $this-&gt;connection);
  </code></pre>
  
  <p>}</p>
  
  <p>That code returns if there is an exact match in the database. 
  But i put two usernames together like "username1 &amp; username2" and need to check if the username session is present in that field.</p>
  
  <p>Is that a way to do this? It obviously woudn't equal it.</p>
  
  <p>ANOTHER UPDATE: </p>
  
  <p>If i use the like %username% in the sql, will it appear if its just the username. So rather than Luke &amp; Matt being shown, if its just Luke will that show too? I dont want it to, i just want things that arent. Can you put != and LIKE so you only get similar matches but not identical?</p>
  
  <p>Cheers</p>