Page 1 of 1

Unexpected '\' ...?

Posted: Fri Oct 29, 2004 4:36 am
by Steveo31
Some regex feyd gave me some time ago... works great except for the error:

Code: Select all

$output = preg_replace('|\[div](.*?)\[/div]|ise',"str_replace('<br />', null, "<div class='div_code'>".highlight_string('\\1',true)."</div>")", $row['body']); 
    echo nl2br($output);
Shows:

Code: Select all

if(isset($_POST['rememberme'])){
    setcookie(
Warning: Unexpected character in input: ''' (ASCII=92) state=1 in c:\phpdev\www\public\emun\local new\includes\content\code.php(96) : regexp code on line 8
"logged", ucwords($_POST['username']), time()+100000);
}
?>
Google came back without much. I tried echoing it stripslashes, addslashed, and all. Nada.

:?: