Skip to content

Instantly share code, notes, and snippets.

@anubhavbhatt
Last active September 3, 2019 09:13
Show Gist options
  • Save anubhavbhatt/ce4f6149febd1bffda37979ff86f0ff1 to your computer and use it in GitHub Desktop.
Save anubhavbhatt/ce4f6149febd1bffda37979ff86f0ff1 to your computer and use it in GitHub Desktop.
Phone number CTA Link
<?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>
@anubhavbhatt
Copy link
Author

Stripping parenthesis, spaces, and hyphens in the phone number using PHP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment