|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-16 13:52 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 04:00:01 2025 UTC |
Description: ------------ In preg_replace function,you are replacing one string to other if replacing string contains $ sign in it,then preg_replace suppress $ sign and 2 charcaters after that $ sign This happens in all PHP 5 versions Reproduce code: --------------- $pattern[] = "/_BASEURL_/"; //$pattern[] = "/_BASELOGIN_/"; $pattern[] = "/_SENDERNAME_/"; $pattern[] = "/_ISSUETITLE_/"; $pattern[] = "/\'\'/"; $replacement[] = BASEURL; $replacement[] = $msg_sendername; $replacement[] = $istitle; $replacement[] = "'"; $msg_body = preg_replace($pattern, $replacement, $msg_body); if $istitle = "This is $888 ruppes"; Then It will replace it with "This is 8 rupees"