Nov092012
CSS 中文字体的英文名称
华文细黑:STHeiti Light
[STXihei]
华文黑体:STHeiti
华文楷体:STKaiti
华文宋体:STSong
华文仿宋:STFangsong
俪黑
Pro:LiHei Pro Medium
俪宋 Pro:LiSong Pro Light
标楷体:BiauKai
苹果俪中黑:Apple
LiGothic Medium
苹果俪细宋:Apple LiSung Light
Windows的一些:
新细明体:PMingLiU
细明体:MingLiU
标楷体:DFKai-SB
黑体:SimHei
宋体:SimSun
新宋体:NSimSun
...阅读全文
作者:绝缘体.. | 分类:CSS | 阅读: |
抢沙发
Oct292012
php 获取货币汇率api
// 货币汇率
function currency($from_Currency, $to_Currency, $amount) {
// currency ( "USD", "CNY", 1 );
$amount = urlencode ( $amount );
$from_Currency = urlencode ( $from_Currency );
$to_Currency = urlencode ( $to_Currency );
$url = "http://www.google.com/ig/calculator?hl=en&q={$amount}{$from_Currency}=?{$to_Currency}";
$ch = curl_init ();
...阅读全文
作者:绝缘体.. | 分类:PHP | 阅读: |
Oct272012
php empty()和isset()的区别
在使用 php 编写页面程序时,我经常使用变量处理函数判断 php 页面尾部参数的某个变量值是否为空,开始的时候我习惯了使用 empty() 函数,一直也没发现什么,但是今天我却发现了一些问题,因此改用 isset() 函数,问题不再。
顾名思义,empty() 判断一个变量是否为“空”,isset() 判断一个变量是否已经设置。正是这种所谓的“顾名思义”,令我开始时走了些弯路:当一个...阅读全文
作者:绝缘体.. | 分类:PHP | 阅读: |
Oct222012
php获取某网站的快照时间
<html>
<head>
<title>在线演示_php获取某网站的快照时间 http://blog.qita.in</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="百度,baidu,查询快照结果">
<meta name="description" content="php查询网站快照日期: by enenba.com">
</head>
<body>
<?...阅读全文
作者:绝缘体.. | 分类:PHP | 阅读: |
Oct222012
php获取百度关键词查询结果总数
<html>
<head>
<title>在线演示_php获取百度关键词查询结果总数</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="百度,baidu,查询结果">
<meta name="description" content="php获取百度关键词查询结果总数 by enenba.com">
</head>
<body>
<?php $k=is...阅读全文
作者:绝缘体.. | 分类:PHP | 阅读: |
Oct222012
通过淘宝API接口查询客户端地址
<?php
/*
* 通过淘宝API接口查询客户端地址 调用淘宝的API接口http://ip.taobao.com/service/getIpInfo.php?ip=ip地址
*/
function get_ip_data() {
$ip = file_get_contents ( "http://ip.taobao.com/service/getIpInfo.php?ip=" . get_client_ip () );
$ip = json_decode ( $ip );
if ($ip->code) {
return false;
}
$data = ( array ) $ip->data;
return ...阅读全文
作者:绝缘体.. | 分类:PHP | 阅读: |
Oct222012
PHP加密解密函数
<?php
//加密
function passport_encrypt($txt, $key) {
srand ( ( double ) microtime () * 1000000 );
$encrypt_key = md5 ( rand ( 0, 32000 ) );
$ctr = 0;
$tmp = '';
for($i = 0; $i < strlen ( $txt ); $i ++) {
$ctr = $ctr == strlen ( $encrypt_key ) ? 0 : $ctr;
$tmp .= $encrypt_key [$ctr] . ($txt [$i] ^ $encrypt_key [$ctr ++]);
}
return ba...阅读全文
作者:绝缘体.. | 分类:PHP | 阅读: |
Oct222012
http请求处理类(基于CURL进行封装)
/**
* http请求处理类(基于CURL进行封装)
*
* @author 绝缘体
* @version $Id$
*/
class cls_http_request
{
/**
* get方式请求(curl)
*
* @param string $url 请求的url
* @param integer $timeout 超时时间(s)
* @return string(请求成功) | false(请求失败)
*/
public static function curl_...阅读全文
Aug122012
PHP中的魔术方法总结
PHP中的魔术方法总结 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep, __wakeup, __toString, __set_state, __clone and __autoload
1、__get、__set
这两个方法是为在类和他们的父类中没有声明的属性而设计的
__get( $property ) 当调用一个未定义的属性时访问此方...阅读全文
Aug122012
snoopy(强大的PHP采集类) 详细介绍
Snoopy是一个php类,用来模拟浏览器的功能,可以获取网页内容,发送表单,可以用来开发一些采集程序和小偷程序,本文章详细介绍snoopy的使用教程。
Snoopy的一些特点:
抓取网页的内容 fetch
抓取网页的文本内容 (去除HTML标签) fetchtext
抓取网页的链接,表单 fetchlinks fetchform
支持代理主机
支持基本的用户名/密码验证
支...阅读全文