title: PHP array_key_exists key LIKE string, is it possible?
body: <p>I've done a bunch of searching but can't figure this one out.</p>
  
  <p>I have an array like this:</p>
  
  <pre><code>$array = array(cat =&gt; 0, dog =&gt; 1);
  </code></pre>
  
  <p>I have a string like this:</p>
  
  <pre><code>I like cats.
  </code></pre>
  
  <p>I want to see if the string matches any keys in the array. I try the following but obviously it doesn't work.</p>
  
  <pre><code>array_key_exists("I like cats", $array)
  </code></pre>
  
  <p>Assuming that I can get any random string at a given time, how can I do something like this?</p>
  
  <p>Pseudo code:</p>
  
  <pre><code>array_key_exists("I like cats", *.$array.*)
  //The value for cat is "0"
  </code></pre>
  
  <p>Note that I want to check if "cat" in any form exists. It can be cats, cathy, even random letter like vbncatnm. I am getting the array from a mysql database and I need to know which ID cat or dog is.</p>