Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not getting correct reports

    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
    ********************

  • #2
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    ...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?
    Last edited by NancyJ; 07-06-2005 at 12:08 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •