title: how to find and modify several elements in an array?
body: <p>I have an array of names. Some names have upper case as first letter, some have space between first name and last name. It looks like this:</p>
  
  <pre><code>array(
  0 =&gt; janet,
  1 =&gt; John Smith,
  2 =&gt; Fred,
  3 =&gt; joe-hooker
  )
  </code></pre>
  
  <p>I want everything in lowercase. If there's a space between first/last name,  change the space to "-" .</p>
  
  <p>How to do it in php language? Thanks!</p>