Programming Tips - PHP: the best way to remove/delete punctuation from a string in php

Date: 2009may28 Language: php Keywords: erase, punct Q. PHP: the best way to remove/delete punctuation from a string in php A. Like this:
function removePunct(string $s): string { return pregReplaceAll('/[[:punct:]]+/', '', $s); } function exampleUse() { $b = "What's Up?"; $b = removePunct($b); print "b=$b"; }
See also http://www.davekb.com/search.php?target=pregReplaceAll