title: php how to escape a string for preg_match?
body: <p>I'am trying to pass a string </p>
  
  <pre><code>  preg_replace('/'.preg_quote($my_str).'/i', '', $string);
  </code></pre>
  
  <p>but I get an error</p>
  
  <pre><code>preg_replace(): Unknown modifier '\'
  </code></pre>
  
  <p>is there any other solutions to escape those backslashes?</p>