04 2014 档案
摘要:如果我们运行php时发现缺少某个库,在windows环境下很简单,找到.dll 对应的库文件,然后拷贝到 extension 目录下,然后在php.ini 里 去掉 前面的分号或者 追加一行 extension = XXXX.dll 即可。linux环境下,可不是像windows环境下那么的简单。下...
阅读全文
摘要:在 Linux 下,如果你写好了自己的动态链接库,需要在其它程序里调用,则需要让这些程序能找到这些动态链接库。如果设置不对,会出现类似如下的错误:test: error while loading shared libraries: libexampleso.so.0: cannot open sh...
阅读全文
摘要:1. 日期输出格式化所有日期、时间的api都在datetime模块内。1. datetime => stringnow = datetime.datetime.now()now.strftime('%Y-%m-%d %H:%M:%S')输出2012-03-05 16:26:23.870105strf...
阅读全文
摘要:MySQLdb/mysql-python安装时EnvironmentError: mysql_config not found
阅读全文
摘要:在redis 中存储中文,读取会出现乱码(其实不是乱码,只是不是我们存的中文显示)1 redis> set test "我们" 2 OK 3 redis> get test 4 "\xe6\x88\x91\xe4\xbb\xac" 如何在get时取到它的中文呢?只需要在redis-cli 后...
阅读全文
摘要:1 $info["fulltext"] = preg_replace_callback(2 $search2,3 function($matches) use ($search, $uniq) {4 return preg_replace($search,$uniq,$matches[0]);5 },6 $info["fulltext"]7 );
阅读全文
摘要:location/keywords {indexindex.php;try_files$uri$uri//keywords/index.php?q=$uri&$args;}apache:.htaccess 1 Options +FollowSymLinks 2 IndexIgnore */* 3 RewriteEngine on 4 #RewriteCond %{REQUEST_URI} !^.*(\.htm|\.xml|\.css|\.js|\.gif|\.png|\.jpg|\.jpeg|\.GIF|\.PNG|\.JPG|\.JPEG|\.DAT|\.dat|\.php)$|.*
阅读全文
摘要:/** * GBKASCII转换成utf8 */ public function to_utf8($str){ $detect = array('ASCII', 'GBK', 'UTF-8'); $encoding = mb_detect_encoding($str, $detect); $str = mb_convert_encoding($str, 'UTF-8', $encoding); return $str; }
阅读全文