如何创建通用callto(tel://)电话标题位置?

I need to create page that will be launch call to phone number function. I use this code:

header("Location: tel:+79999999999");
exit();

It's work good on smartphones, but not work on desktops. How to create universal call phone function?

The tel:// scheme's availability on your clients' browsers is dependent on:

  • if the browser supports said scheme, and
  • if the user has an application on their device to handle the request.

The reason header("Location: tel:+79999999999"); may only be working on your phone is because your phone has an app to handle such request; whereas your PC may not.


How to create universal call phone function?

Using header("Location: tel:+79999999999"); is the closest thing you'll get to what you're looking for (after all, you can't force a user to phone a number if they don't have the means to do so!)