摘要:
/** +---------------------------------------------------------- * 字符串截取,支持中文和其他编码 +---------------------------------------------------------- * @static * @access public +---------------------------------------------------------- * @param string $str 需要转换的字符串 * @param string $start 开始位置 * @param stri 阅读全文
posted @ 2012-03-20 21:49
小 伍
阅读(3448)
评论(0)
推荐(0)
摘要:
function get_client_ip() {
static $ip = NULL;
if ($ip !== NULL) return $ip;
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$pos = array_search('unknown',$arr);
if(false !== $pos) unset($arr[$pos]);
$ip = trim($arr[0]);
}elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
}elseif (isset($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMO 阅读全文
posted @ 2012-03-20 21:46
小 伍
阅读(335)
评论(0)
推荐(0)

浙公网安备 33010602011771号