title: php string inside array filtering
body: <p>Hello I have created a $person = array(...) and a foreach loop that iterate through the array.
  I'm trying to figure out how to echo/print out all string that has "Dr." prefixes.</p>
  
  <pre><code>&lt;?php
  
  $persons = [
      "Dr. Cooper",
      "Mrs. Dalloway",
      "Mr. Dalloway",
      "Dr. Mabuse",
      "Col. Stephens",
      "Dr. Ashcroft"
  ];
  
  foreach($persons as $person) {
      echo '&lt;li&gt;'. $person . '&lt;/li&gt;'. '&lt;br /&gt;';
  }
  </code></pre>
  
  <p><strong>Disclaimer:</strong> I've started a new course on php and database, and trying to practice asking questions on internet forums. I have good understanding of javascript, so it would benefit me if you could compare the solution with javascript. Otherwise just explain the solution. Thanks in advance!</p>