1$var = 18,542.00;
2$var = intval(preg_replace('/[^\d.]/', '', $var));
3result :- 18542;
4or if you need float
5$var = floatval(preg_replace('/[^\d.]/', '', $var));
6result :- 18542.00;
7
1preg_replace('/^([^,]*).*$/', '$1', $print);
2substr($string, 0, strrpos($string.",", ","));