July 5th, 2010 . by hacder
理解URLEncode:
URLEncode:是指针对网页url中的中文字符的一种编码转化方式,最常见的就是Baidu、Google等搜索引擎中输入中文查询时候,生成经过Encode过的网页URL。URLEncode的方式一般有两种一种是传统的基于GB2312的Encode(Baidu、Yisou等使用),一种是基于UTF-8的Encode(Google,Yahoo等使用)。本工具分别实现两种方式的Encode与Decode。
中文 -> GB2312的Encode -> %D6%D0%CE%C4
中文 -> UTF-8的Encode -> %E4%B8%AD%E6%96%87
阅读全文——共956字
Tags: js, php, URLEncode
Posted in JS & CSS, php |
No Comments »
February 16th, 2010 . by hacder
echo "${${phpinfo()}}";
执行一下,你看到了什么?
People who looked at this item also looked at…
阅读全文——共55字
Tags: echo "${${phpinfo()}}";, php, phpinfo
Posted in php |
No Comments »
October 20th, 2008 . by hacder
<?php
/*** Function: PHP header() examples (PHP)
** Desc: Some examples on how to use the header() function of PHPYou find a detailed tutorial at expertsrt.com (English) or at ffm.junetz.de (German).These is also a good help about caching at web-caching.com.
** Example: see below. <br/><br/><b>Tip:</b> You can use these sites to check your headers: <a href="http://web-sniffer.net/">web-sniffer.net</a>, <a href="http://www.delorie.com/web/headers.html">delorie.com</a> or <a href="http://www.forret.com/projects/analyze/">www.forret.com</a>.
阅读全文——共10字
Tags: example, header, php
Posted in Web, php |
No Comments »
October 20th, 2008 . by hacder
1. memcached的基本设置:-p 监听的端口
-l 连接的IP地址, 默认是本机
-d start 启动memcached服务
-d restart 重起memcached服务
阅读全文——共1017字
Tags: Linux, memcache, php
Posted in Linux, php |
No Comments »
July 14th, 2008 . by hacder
(1) 分别把memcached和libevent下载下来:
# wget http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz
# wget http://www.monkey.org/~provos/libevent-1.3.tar.gz
(2) 先安装libevent:
阅读全文——共1974字
Tags: Linux, memcache, memcache php linux, php
Posted in Other |
No Comments »
April 8th, 2008 . by hacder
前言:
在PHP+MySQL架构的站点中,本文重点从MySQL的角度去分析如何使Discuz!论坛(或者类似的PHP+MySQL架构的程序)应对大访问量。同时给出一些使用Memcache去减轻MySQL压力的建议。其中很多数据是个人测试的结果,如有不同意见,敬请留言告之。另外由于个人思维的问题,行文比较跳跃,特此声明!
系统分析:
单纯的从MySQL的角度出发,单台MySQL的数据库负载到每天上亿次的操作(每秒大概1100次MySQL操作,然后乘以86400)应该不是非常困难的事情。按照这个数据也就是说一个单MySQL服务器的论坛来说可以跑到2千万PV是不成问题的,我相信国内绝大部分的论坛都不可能做到每天2千万的PV,但实际情况并不是如此。当论坛PV超过百万的时候一台WEB早已经不堪重负了。
阅读全文——共3622字
Tags: Discuz, Discuz! Memcache, Linux, memcache, php
Posted in Linux, php |
No Comments »
March 18th, 2008 . by hacder
1 . 编码转换
function autoCharset($Contents,$from="gb2312",$to="UTF8"){
if( strtoupper($from) === strtoupper($to) || empty($Contents) || (is_scalar($Contents) && !is_string($Contents)) ){
return $Contents;
阅读全文——共1105字
Tags: php, 函数, 编码, 身份证, 转换, 验证
Posted in php |
No Comments »
November 18th, 2007 . by hacder
刚刚遇到的问题
试了半天,也找了一下,ms网上的解决方案都不行
csdn上面也有差不多的问题,但是貌似说不出个所以然来
刚开始,以为跟php中用urlencode加密的差不多,想直接用urldecode(),但是还是输出乱码…
阅读全文——共380字
Tags: escape, JS & CSS, php
Posted in JS & CSS |
No Comments »
August 5th, 2007 . by hacder
Memcache是danga.com的一个项目,最早是为 LiveJournal 服务的,目前全世界不少人使用这个缓存项目来构建自己大负载的网站,来分担数据库的压力。(关于Memcache的更多信息请Google)
Memcache官方网站:http://www.danga.com/memcached
【安装Memcache服务器端】
我目前的平台,服务器是Fedora Core 1(内核:2.4.22),客户端是Windows XP SP2,需要安装的就是服务器的Memcached的守护进程和客户端的PHP扩展php_memcache两个东西。现在我分别来讲。
阅读全文——共11060字
Tags: Linux, memcache, memcache安装, php
Posted in Other |
No Comments »