让电话号码,点击拨号屏幕上移动?(make phone number clickable to di

2019-08-16 20:18发布

How can i make a phone number that's being echoed in php from mysql database?

I'm new to php and mysql and still learning, please can someone explain or show me how to make a phone number clickable to go to the dialing screen on a mobile.

Here's the code im using below, i some how need to adapt the hyperlink aroung my '

<?php
$user_type_set = user_type_profile();
while ($user = mysql_fetch_array($user_type_set)) { ?>

<div class="contact-buddy"></div><div class="contact-buddy2"></div>
<div class="contact_details_phone"><p><strong>Phone: <div class="phone_font"><strong><?php echo $profile['contact_number'] ?></strong></div></div></p>
<div class="contact_details_email"><p><strong>Email:&nbsp;&nbsp;<?php echo $profile['public_email'] ?></strong></p></div>

<? } ?>

Answer 1:

这应该在iPhone肯定工作,但我相信它会为机器人正常工作。 你的PHP应该输出,因为它是相似到最终产品的东西:

<a href="tel:1-800-555-5555">1-800-555-5555</a>


Answer 2:

如果你想通过返回的手机号码<?php echo $profile['contact_number'] ?>点击,那么你可以使用内联PHP直HTML代码块:

<a href="tel:<?php echo $profile['contact_number']; ?>"><?php echo $profile['contact_number']; ?></a>

或者清理了一下这个PHP:

<?php
$phone = $profile['contact_number'];
echo "<a href="tel:$phone">$phone</a>";
?>

哪种方法你想要的。



文章来源: make phone number clickable to dial screen on mobile?