源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

9段PHP实用功能的代码推荐

  • 时间:2022-06-29 22:09 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:9段PHP实用功能的代码推荐
[b]一、查看邮件是否已被阅读[/b]   当你在发送邮件时,你或许很想知道该邮件是否被对方已阅读。这里有段非常有趣的代码片段能够显示对方IP地址记录阅读的实际日期和时间。
$email\">$email</a>"; }    function make_clickable($ret) {     $ret = ' ' . $ret;     // in testing, using arrays here was found to be faster     $ret = preg_replace_callback('#([\s>])([\w]+?://[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_url_clickable_cb', $ret);     $ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_web_ftp_clickable_cb', $ret);     $ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);        // this one is not in an array because we need it to run last, for cleanup of accidental links within links     $ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret);     $ret = trim($ret);     return $ret; }
[b]  五、创建数据URL[/b]   数据URL可以直接嵌入到HTML/CSS/JS中,以节省大量的 HTTP请求。 下面的这段代码可利用$file轻松创建数据URL。
[url=http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$page_id]http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$page_id[/url]."") or die ("a lot");     $fans = $xml->page->fan_count;     echo $fans; ?>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部