remove string after comma in php

Solutions on MaxInterview for remove string after comma in php by the best coders in the world

showing results for - "remove string after comma in php"
Isabel
16 Feb 2016
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
Adriana
09 Jan 2018
1preg_replace('/^([^,]*).*$/', '$1', $print);
2substr($string, 0, strrpos($string.",", ","));
Nisa
07 Sep 2019
1$print=preg_replace('/^([^,]*).*$/', '$1', $print);
queries leading to this page
php remove comma from valueremove comma from amount laravelremove comma string between the object phpremove comma from number format phphow to remove specific value from comma separated string in phpremove multiple comma from string in phpphp number format remove comma how to remove specific key value from comma separated string in phpphp remove string after commahow to remove word after semicolon using phpremove string and coma from digit in phpremove comma from string in phpstr replace to remove comma phpphp remove array values comma how to remove empty comma from string phpremove comma from price in phpphp remove comma and dollar sign from numberphp remove comma at start of wordremove string where there is comma phpremove before comma all text in phpphp remove one comma from stringphp remove all characters after commaremove comma from a number in phpremove commas from string phpremove comma string phpremove string comma phpremove all commas phpphp remove comma from numbersphp remove comma from end of stringremove comma from array phpphp remove comma from amountremove comma from price phphow to remove comma from starting and end of string phpremove comma phpremove comma from string php rtrimremove comma from number phpcreate a string out of comma del text phpremove comma in number phpremove string after comma in phphow to remove particular key from comma separated string in phphow to remove comma in php datahow to remove comma from string phpremove comma from string php expldephp remove after commaremove comma 27s phpremove comma in number format phpremove multiple comma phpremove comma number format phpphp remove comma from arrayphp remove comma from stringremove comma from a non numeric string phphow to remove comma from string array in phpphp remove word from comma separated stringremove comma from number format in phpremove comma from number in phpremove starting and ending comma from string phpnumber format remove comma phpphp how to remove comma from stringphp function that remove comma separator on a numberphp remove characters from string if commaremove behind comma phpphp remove all comma from stringhow to remove specific key from comma separated string in phpphp remove comma from beginning of stringhow to remove comma from string in phpphp remove all comma from arrayhow to remove extra comma from end of stirng phpremove comma 00 from phpphp remove comma from string numberremove commas from a string in phpremove all commas from string phphow to remove a value from comma separated string in phpremove comma from a string phpphp function to remove a comma in the arrayremove comma and 00 from phphow to remove comma in number format in phpremove number after comma phpremove comma or dot phpremove comma in phpphp string remove comma and afterhow to remove one comma from a php in arrayremove the comma from a number in phpremove commas and dots from a string in phphow to remove extra comma in phpremove extra comma from string in phpreplace all after comma phpphp remove trailing commatrim comma from variable in phpphp remove comma from the end of the stringremove value from comma separated string phpphp regex remove after commaphp remove comma from numberphp remove a name seperated by coma from stringremove all comma from string phpremove commas in array phpphp string delete after commaremove digits after comma phpremove comma if infront or end of string phpphp function to remove commas from stringremove comma from start and end of string phpremove commas in phpremove comma from string phpremove comma in numeric in phpremove comma at end phpremove comma from a string phpphp remove commas from numeric stringshow to remove comma in phpremovelast comma in phpmultiple comma remove from string in phpphp unformat number remove commaremove empty comma from string phpremove comma from end of string phpphp remove comma from variableremove 0 value from comma separated string in phpremove comma and space at end of string phpremove comma in string phpremove after comma in phpremove string after comma in php