|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-04 10:21 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Description: ------------ the eregi_replace seems to have a problem with replacing backslach. I made a function that should replace a \ with \\ and I got this error message: <b>Warning</b>: eregi_replace(): REG_EESCAPE:Ptrailing backslash (\) in .... Reproduce code: --------------- function JavascriptEncode($str1) { $str1 = eregi_replace(chr(92),chr(92).chr(92),$str1); return $str1; } this fonction doesn't work. function JavascriptEncode($str1) { $str1 = eregi_replace(chr(92).chr(92),chr(92).chr(92),$str1); return $str1; } this fonction replace \ by \\ ( it works, but why ???)