php preg_replace , I need to replace everything after a dot (e.g 340.38888 > need to get clean 340)
- by Michael
I need to replace everything after a dot . I know that it can be done with regex but I'm still novice and I don't understand the proper syntax so please help me with this .
I tried the bellow code but doesn't work :
$x = "340.888888";
$pattern = "/*./"
$y = preg_replace($pattern, "", $x);
print_r($x);
thanks ,
Michael