Last active
September 3, 2019 09:13
-
-
Save anubhavbhatt/ce4f6149febd1bffda37979ff86f0ff1 to your computer and use it in GitHub Desktop.
Phone number CTA Link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$contact_number = "(123) 456-7890"; | |
$contact_number_link = preg_replace('/\D+/', '', $contact_number); | |
?> | |
<a href="tel://<?php $contact_number_link; ?>" target="_self"> | |
<span>CALL US 24/7<br><strong><?php $contact_number?></strong></span> | |
</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stripping parenthesis, spaces, and hyphens in the phone number using PHP