I have this edition for an update, where the value is a decimal number with 15.2 (fifteen whole digits and 2 decimals) and replacement comma (,) by period (.) to add it to a database.
include ("connection_upload_csv.php");
if(isset($_POST["submit"]))
{
$file = $_FILES['file']['tmp_name'];
$handle = fopen($file, "r");
$c = 0;
while(($filesop = fgetcsv($handle, 1000, ";")) !== false)
{ {
$entrega_importe = (str_replace(',', '.', $filesop[14]));
$sql = mysql_query("INSERT INTO " . TABLE_ENTREGAS . " (entrega_importe)
VALUES ('$entrega_importe')");
}
but I have a problem if the number comes from the origin like this:
1,044.00
I need you to replace the comma of the decimal point, and if the number contains a point of the thousands erase it, or replace by ('') but only for the thousands.
the result after the update should be:
1044.00
how can I do the str_replace so that it makes those two changes in the same variable. $entrega_importe =