Re: preg_replace Question

From: Date: Fri, 04 Apr 2008 09:53:10 +0000
Subject: Re: preg_replace Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-272516@lists.php.net to get a copy of this message
Richard Luckhurst wrote: > e.g $amount = $524.00 however only 4.00 is displayed in the %Amount > field on the html page. I tried dropping the .00 from $amount to see > if this might be a length issue and then %Amount was just 4 > Am I doing something obviously wrong here? I have checked the php > manual and I appear to be using preg_replace correctly. >From the manual: "replacement may contain references of the form \\n or (since PHP 4.0.4) $n, with the latter form being the preferred one" If you use $amount ='\$524.00' instead of '$524.00', it'll work. /Per Jessen, Zürich

« previous php.general (#272516) next »