I am trying to match digit and .
and replacing it with ""
no char.
$buffer= "test. 8090";
if PREG_REPLACE('/[0-9]+[.]/', '', $buffer)
{
echo $buffer;
}
What's wrong here? gives syntex error
Put both digit and dot inside the character class []
$new_str = PREG_REPLACE('/[0-9.]+/', '', $buffer);
^ here goes the dot
Don't put preg_replace inside the if statement
,it doesnot return true or false.
Change the regex pattern like this \([\d+.])\
preg_replace("/[.\d]+/", "", $buffer);