Javascript 保护显示联系人号码

Javascript 保护显示联系人号码,javascript,php,html,twitter-bootstrap,Javascript,Php,Html,Twitter Bootstrap,我有一个分类网站,在页面的产品详细信息中,联系人号码显示为普通文本。这些数字在搜索引擎结果中可见。如何保护手机号码或如何将手机号码显示为图像以隐藏在SE面前?您可以执行类似的操作。这会将您的电话号码打印为图像 <?php $img = imagecreate(100, 20); //dimension of image $bg = imagecolorallocate($img, 255, 255, 255); //Give white background $textcolor = i

我有一个分类网站,在页面的产品详细信息中,联系人号码显示为普通文本。这些数字在搜索引擎结果中可见。如何保护手机号码或如何将手机号码显示为图像以隐藏在SE面前?

您可以执行类似的操作。这会将您的电话号码打印为图像

<?php
$img = imagecreate(100, 20); //dimension of image

$bg = imagecolorallocate($img, 255, 255, 255); //Give white background
$textcolor = imagecolorallocate($img, 0, 0, 0); //Gives black colour to string. Both follow format in format (image, Red, Green, Blue)
$phone = "1234567890";
imagestring($img, 6, 2, 2, $phone, $textcolor);
// imagestring ( resource $image , int $font , int $x , int $y , string $string , int $color )

// Output the image
header('Content-type: image/png');

imagepng($img); //Outputs a png image
imagedestroy($img); //frees any memory associated with image
?>


数字只是位图还是像反向验证码问题一样被破坏?您尝试过的一些代码怎么样,或者这是一个探索阶段?就目前的情况而言,您可能需要一个插件或库,这可能会导致在SO结束这里的问题。谢谢。数字保存在mysql数据库中。我不知道如何像文本一样显示它。