View Full Version : Not getting correct reports

07-06-2005, 10:38 AM
Hi All,

For our client we will send all the captured data in the form of HTML Reports using PHP. In reporting we have a field called Comments. Iam using preg_replace(). If the comment filed contains $10,000 then after calling the fuction preg_replace() i am getting ,000. Can any one plz help me.I am giving my sample code below.

$repdata = "$10,000";
$replacepatterns[0] = $repdata;
$this->message = preg_replace($patterns, $replacepatterns, $replacepatterns);

Result should be

But iam getiing As

07-06-2005, 12:03 PM
...maybe I'm being dumb here but it seems to me like you want to put $10,000 in and get $10,000 out... then why run a function at all...

that to me reads as

look in the string "$10,000" and replace the $pattern (which you havent included) with "$10,000"

...what are you expecting the input to be and what are you expecting the output to be?