PDA

View Full Version : Stripping Commas


jay
09-21-2009, 10:30 AM
Hi

I am using DW CS4 with PHP.

I wrote a script(JS) to add commas to the price field so that users may more accurately enter the price.

How do I remove those commas before feeding the DB?

Thanx Jay

jay
09-21-2009, 08:09 PM
anyone..........

domedia
09-22-2009, 04:41 PM
Moved to PHP

jay
09-22-2009, 05:34 PM
Thank you..

m1a2x3x7
09-22-2009, 08:32 PM
Something like this should work.


<?php
$price = $_POST["price_field"];

$price = str_replace(",","", $price);
?>


-M