Skip to content

Instantly share code, notes, and snippets.

@morad7
Created July 28, 2019 10:26
Show Gist options
  • Save morad7/38d21a5c137e8512395b05aa26d46618 to your computer and use it in GitHub Desktop.
Save morad7/38d21a5c137e8512395b05aa26d46618 to your computer and use it in GitHub Desktop.
Replace comma with dot php/mysql
//php
$num = (int) "10";
$num = (double) "10.12"; // same as (float) "10.12";
//mysql
update table
set myColumn = replace(myColumn, ',', '.')
where myColumn like '%,%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment