Removing commas from number

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

 



Thanks to the suggestions, I use number_format($my_number, 2) to format the number in an edit field. Now I need to reenter it into MySQL. How should I use preg_replace to remove the commas?

This removes the commas *and* the decimal point:

preg_replace('/\D/', '', $str)

In reviewing patterns, I cannot find the purpose of the "/" character in the above.

Many thanks....

Todd

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