preg_replace Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi List

I am trying to perform a number of replacements of place holders in an html page
I am working on using preg_replace. I am stuck with a pronlem I can not work out
and would appreciate some help.

The code I have is as follows

        $html = preg_replace('/%Amount/',$amount,$html);

$html is the source of a html page
$amount is set earlier to a value read from a file

When I view the html page the value of %Amount is not what I would expect.

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.


Regards,
Richard Luckhurst                      
Product Development
Exodus Systems - Sydney, Australia.
rluckhurst@xxxxxxxxxxxxx
Tel: (+612) 4751-9633
Fax: (+612) 4751-9644
Web: www.resmaster.com 
=================================================
Exodus Systems - Smarter Systems, Better Business
=================================================


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux