“Remova a string após a vírgula no PHP” Respostas de código

Remova vírgula em numérico em php

$var = 18,542.00;
$var = intval(preg_replace('/[^\d.]/', '', $var));
result :- 18542;
or if you need float
$var = floatval(preg_replace('/[^\d.]/', '', $var));
result :- 18542.00;
Tyagi420

Remova a string após a vírgula no PHP

preg_replace('/^([^,]*).*$/', '$1', $print);
substr($string, 0, strrpos($string.",", ","));
Tyagi420

Remova atrás de vírgula php

$print=preg_replace('/^([^,]*).*$/', '$1', $print);
Andrew Lautenbach

Respostas semelhantes a “Remova a string após a vírgula no PHP”

Perguntas semelhantes a “Remova a string após a vírgula no PHP”

Mais respostas relacionadas para “Remova a string após a vírgula no PHP” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código