title: use str_replace for a single variable
body: <p>how would i use str_replace to replace all '.' in a variable to '-', for a single variable?</p>
  
  <p>so for example</p>
  
  <pre><code>$var1 = 'hello.world';
  $var2 = // somehow use str_replace to change . to - for content of var1?
  print var2;
  </code></pre>
  
  <p>would output:  'hello-world'.</p>
  
  <p>From my reading it looks like str_replace would be the best thing to do this but i cant work out how. If there is a different/better way i would be glad to learn that too.</p>
  
  <p>Thanks in advance for any help</p>