I have this to get rid of everything except numbers
$string2 = preg_replace(“/[^0-9]/”,””,$string);
But I also want it to keep – and .
Also can someone please explain how it works, I really don’t get it.
✅ Answers
? Best Answer
I have this to get rid of everything except numbers
$string2 = preg_replace(“/[^0-9]/”,””,$string);
But I also want it to keep – and .
Also can someone please explain how it works, I really don’t get it.
? Best Answer