title: How to extract words from a string that end with substrings listed in an array?
body: <p>How is it possible to print all words from a string with ends with specific letters like for example:</p>
  
  <pre><code>$words = "lernen spielen betteln lachen example"; 
  $EndsWith=['en','eln'];
  </code></pre>
  
  <p>In this example should everything be printed except of the word example.</p>
  
  <p>I only know how to find the characters with <code>substr</code>, but this works only for one the last word in a string.</p>