![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PHP
文章平均质量分 64
moky
第七个疯子
展开
-
[PHP] Shared memory access
<?php /** * Description: * Shared memory access * * History: * Created by Moky @ 2009-07-28 */ /** Samples: include_once(include/lib/shm.php);原创 2009-07-28 17:16:00 · 349 阅读 · 0 评论 -
[PHP] include/lib/magic_log.php
<?php/** * Description: * Functions to save log into file. * * History: * Created by Moky @ 2009-04-21 *//*//-- Usage: include_once(include/magic_log.php); //magi原创 2009-07-31 00:11:00 · 348 阅读 · 0 评论 -
为 PHP 添加 CURL 模块
从网上 down 了一个 curl-7.17.1.tar.gz ,解压/编译:cd /home/moky/downloads/curl-7.17.1./configure --prefix=/usr/local/curl --with-ssl提示未安装 openssl 于是又 down 了一个 openssl-1.0.0-beta3.tar.gz ,解压/编译:cd /home翻译 2009-08-29 14:04:00 · 4117 阅读 · 0 评论 -
[PHP] Session Access
<?php /** * Description: * Functions for session accessing * * History: * Created by Moky @ 2008-07-26 */ /** Samples: include_once(include/lib/session.原创 2009-10-22 17:34:00 · 390 阅读 · 0 评论 -
[php] Chinese String Handling
<?php /** * Description: * Some functions for string handling * * History: * Created by Moky @ 2009-07-28 */ function substring_gb2312($str, $len) { if ($len <=原创 2009-10-22 17:47:00 · 420 阅读 · 0 评论 -
[PHP] 获取客户端IP的几种方法
function get_remote_addr() { if (getenv(HTTP_CLIENT_IP)) { // 代理端的(有可能存在,可伪造) return getenv(HTTP_CLIENT_IP); } else if (getenv(HTTP_VIA)) { // 用户是在哪个IP使用的代理(有可能存在,也可以伪造) $原创 2009-11-20 11:13:00 · 399 阅读 · 0 评论 -
[PHP] 从 json_encode 到 ajax_encode
PHP 5.2 及以上版本提供了 json_encode 和 json_decode 函数,相当好用。而之前的版本则需要下载网友们自行开发的库(有兴趣的可以看下 http://code.itlearner.com/php/JSON-class.html )可以参考如下这个方法来在低版本上扩充这两个函数:if (!function_exists(json_encode) && !fu原创 2009-11-26 22:59:00 · 985 阅读 · 0 评论 -
[PHP] User Defined Extension
为 PHP 添加扩展库是一件简单的事情。不过首先你最好会一点点C/C++编程技术,并且对Makefile有一定的了解。以下是在 Linux 下的一个简单例子: 首先,进入 php 源代码目录(假设为 PHP_SRC,以下同),使用 php 自带的 ext_skel 工具生成一个新扩展 mk4php: cd PHP_SRC/etc;./ext_skel --extname=m原创 2010-01-06 17:58:00 · 505 阅读 · 0 评论