title: preg_replace(): No ending delimiter '@' found
body: <p>I am new at php and I was trying to create a BBcode but it gives me this error:</p>
  
  <blockquote>
    <p>Warning: preg_replace(): No ending delimiter '@' found</p>
  </blockquote>
  
  <p>The code I did:</p>
  
  <pre><code>function bbCode($str){
      $values = array(
                      '@\[b]\(.*?)\[\/b]\@i' =&gt; '&lt;b&gt;$1&lt;/b&gt;',
                      '@\[i]\(.*?)\[\/i]\@i' =&gt; '&lt;em&gt;$1&lt;/em&gt;'
  
                      );
                      return preg_replace(array_keys($values), array_values($values), $str);
  }
  </code></pre>
  
  <p>What is wrong with it?</p>