title: Error when using str_replace in php?
body: <p>I have a sample code:</p>
  
  <pre><code>$text = "abc ABC def ghi Abc aBc xyz";
  $search = "abc"
  $string = str_replace(" ".trim($search)." ", 'DEF', $text);
  echo $string;
  </code></pre>
  
  <p>And result is: "<code>abc ABC def ghi DEF aBc xyz</code>" // only Abc change</p>
  
  <p>But result exactly is: "<code>abc DEF def ghi DEF DEF xyz</code>"</p>
  
  <p>How to fix it ?</p>