title: Check if value 50% or more is matched with the needle in haystack in a multidimensional Array (PHP)
body: <p>I want to check if a value is 50% or more identical in a multidimensional Array as the "needle" i put in.</p>
  
  <p>I got a function that can check if a value is identical in a multidimensional array:</p>
  
  <pre><code>function in_array_r($needle, $haystack, $strict = true) {
      foreach ($haystack as $item) {
          if (($strict ? $item === $needle : $item == $needle) || (is_array($item) &amp;&amp; in_array_r($needle, $item, $strict))) {
              return true;
          }
      }
  
      return false;
      }
  </code></pre>
  
  <p>But i want to return the function true if a given percentage of the value is identical.
  I think that i need to integrating something like: <code>similar_text($value1, $value2, $percent);</code></p>
  
  <pre><code>if {$percent &gt; 50) {
    // do something
  }
  </code></pre>