What is tel:// URLs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • megri
    Administrator
    • Mar 2004
    • 926

    What is tel:// URLs

    The tel:// URLs are used to indicate a telephone link, which can be clicked to initiate a phone call on devices that support this functionality (like smartphones). These are not web URLs but are instead part of the telephone URI scheme. Why tel:// URLs Appear in the Output
    1. HTML Content: The HTML content of the page you're extracting links from may include telephone links. These are typically used in contact sections of websites to allow users to easily click and call a phone number.
    2. Regular Expression: The regular expression used in the script to extract URLs is designed to capture a wide range of URI schemes, not just HTTP or HTTPS. This includes tel://, mailto://, and others. The current regex pattern is:

      preg_match_all("/<a\s+.*?href=["']?([^"' >]+)["' >]/i", $content, $matches);
      This pattern captures anything that follows href=" or href=', which includes telephone links.
    Understanding Telephone Links (tel://)
    • Usage: tel:// links are used to provide a clickable link for phone numbers.

      <a href="tel:+1234567890">Call Us</a>
      This would render a link that, when clicked, prompts the user to call the number +1234567890.
    • Functionality: When clicked on a device that supports telephone links, like a smartphone, it will open the dialer with the number pre-filled. On other devices, it might do nothing or show an error.

    Handling tel:// Links

    If you want to understand or process these links differently, you can add logic to specifically handle or filter them. For example, you could categorize them separately or exclude them from the output based on your requirements.


    Conclusion

    The presence of tel:// links in the output is expected behavior given the broad regular expression used to capture URLs. They are valid URIs that provide functionality for initiating phone calls, and their inclusion reflects the varied nature of links that can be present in HTML content. If you need to treat them differently, you can modify the script to handle or filter them as needed.
    Parveen K - Forum Administrator
    SEO India - TalkingCity Forum Rules - Webmaster Forum
    Please Do Not Spam Our Forum
Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎