Jump to content

[SOLVED] I can't get preg_replace to work and it is driving me mad!!!! plz help


jacktheripper125

Recommended Posts

Hi

 

I have a old payment system that i use but customers keep putting in £ and the protx wont allow them. so i have tried to use the preg_replace to remove it but i just cant get it to work.

I have tried to add it to this line

    <INPUT TYPE="hidden" NAME="Amount" VALUE="<? echo($ThisAmount); ?>">

after the echo along the lines of

  <INPUT TYPE="hidden" NAME="Amount" VALUE="<? echo preg_replace('£', '',$ThisAmount); ?>">

I am clearly being dumb but i am just not sure how dumb and in what way.

 

any help would be hugely aprecheated.

 

thank you

 

Ian

EXCELLENT HAVE SORTED IT WITH

<INPUT TYPE="hidden" NAME="Amount" VALUE="<? echo str_replace('£', '',$ThisAmount); ?>">

this strips out the £ sign,

 

THANK YOU, THANK YOU, FOR YOUR HELP

I can now have my weekend happy with the site fixed

 

p.s. THANK YOU

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.