title: Filtering arrays by strings
body: <p>I have a situation where I have an array of path names, e.g </p>
  
  <pre><code>[0]: /var/www/mysite/fred.md
  [1]: /var/www/mysite/george.md
  [2]: /var/www/mysite/arthur.md
  [3]: /var/www/mysite/.htaccess
  </code></pre>
  
  <p>I have another array of strings </p>
  
  <pre><code>[0]: fred
  [1]: art
  </code></pre>
  
  <p>I want to filter the array of path names so that I end up with an array of items where any part of the path name matches the string - so I should get </p>
  
  <pre><code>[0]: /var/www/mysite/fred.md
  [1]: /var/www/mysite/arthur.md
  </code></pre>
  
  <p>What's the most efficient way of doing this in PHP? </p>