Is it feasible to create a PHP algorithm to parse text and block phone numbers effectively?

To create a PHP algorithm to parse text and block phone numbers effectively, we can use regular expressions to identify phone number patterns and replace them with a placeholder text. This can help in masking or blocking phone numbers from being displayed or used for further processing.

$text = "Please contact me at 123-456-7890 for more information.";

$blocked_text = preg_replace('/\b\d{3}-\d{3}-\d{4}\b/', 'PHONE NUMBER BLOCKED', $text);

echo $blocked_text;