title: preg_replace() [function.preg-replace]: Unknown modifier '/' in /home/
body: <p>in my website i want to replace links with some other link like this</p>
  
  <p><code>www.abc.com</code>  or <code>http://abc.com</code> will be replaced with </p>
  
  <p><code>http://www.XXXXXX.com/sonal?www.abc.com</code></p>
  
  <p>or</p>
  
  <p><code>http://www.XXXXXX.com/sonal?http://abc.com</code></p>
  
  <p>so i am using this code but this code is giving some error</p>
  
  <blockquote>
    <p><code>Warning: preg_replace() [function.preg-replace]: Unknown modifier '/'</code>
    <code>in /home/XXXXX/public_html/YYYYYYYYY/KKKKKK.php on line 495</code></p>
  </blockquote>
  
  <pre><code>$search_array = array(
     "/\[url]www|http://.([^'\"]*)\[\/url]/iU",
     "/\[url]([^'\"]*)\[\/url]/iU",
     "/\[url=www|http://.([^'\"\s]*)](.*)\[\/url]/iU",
     "/\[url=([^'\"\s]*)](.*)\[\/url]/iU"
  );
  $replace_array = array(
     "&lt;a href=\"http://XXXXXX.com/sonal?.\\1\" target=\"_blank\" rel=\"nofollow\"&gt;www.   \\1&lt;/a&gt;",
     "&lt;a href=\"\\1\" target=\"_blank\" rel=\"nofollow\"&gt;\\1&lt;/a&gt;",
     "&lt;a href=\"http://XXXXXX.com/sonal?.\\1\" target=\"_blank\" rel=\"nofollow\"&gt;\\2&lt;/a&gt;",
     "&lt;a href=\"\\1\" target=\"_blank\" rel=\"nofollow\"&gt;\\2&lt;/a&gt;"
  );
  
  $msg = preg_replace($search_array, $replace_array, $msg);
  return $msg;
  </code></pre>