Clean Phone Numbers

This is handy when adding call links with ACF content.


$phone = (307) 555-1234; 
$clean =  preg_replace('/(\W*)/', '', $phone);

echo '<a href="tel:+' .$clean. '">' .$phone. '</a>';

TA DA