...

View Full Version : Not getting correct reports



vvkkishore
07-06-2005, 09: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

***********************
$10,000
*************************
But iam getiing As
********************
,000
********************

NancyJ
07-06-2005, 11:03 AM
...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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum