Then how to several countries that use the currency value with fractional cents?
A first step, you must change the data type for the currency in the table of items (I assume you can use the mysql manager, for example phpMyAdmin), then run the following query
Code: Select all
ALTER TABLE `item` CHANGE `price` `price` DECIMAL( 10, 2 ) NULL DEFAULT NULL ;
Code: Select all
$data['price'] = preg_replace('@[.,\-a-z ]@i', '', strip_tags($_POST['price']));
Code: Select all
[.,\-a-z ]
after edit
Code: Select all
$data['price'] = preg_replace('@[,\-a-z ]@i', '', strip_tags($_POST['price']));
image preview :