控制面板

空间动态

日期:10-05-20 10:25 分享一个分库分表hash算法

?php //分库分表算法 function calc_hash_db($u, $s = 4) { $h = sprintf(%u, crc32($u)); $h1 = intval(fmod($h, $s)); return $h1; } for($i=1;$i2;$i++) { echo calc_hash_tbl($i, 2); echo calc_hash_tbl($i, 3); echo calc_hash_tbl($i, 4); echo

日期:10-03-19 11:11 IP 转数字,数字转IP(整理,多解)

1.手工自己的实现方法 function ip2number($ip){ $t=explode('.',$ip); $x=0; for($i=0;$i4;$i++){ $x = $x*256+$t[$i]; } return $x; } function number2ip($num){ $t=$num; $a=array(); for($i=0;$i4;$i++){ $x=$t%256; if($x0)$x+=256; array_unsh

日期:10-01-15 11:27 修改mysql的表格中字段的顺序问题

CREATE TABLE `tb_area_collect_school_week` ( `id` char(36) NOT NULL, `date_entered` varchar(20) NOT NULL, `date_modified` datetime NOT NULL, `assigned_user_id` char(36) default NULL, `modified_user_id` char(36) default NULL, `created_by` cha

日期:10-01-09 09:57 var_export 很好用,比如输出缓存!

var_export (PHP 4 = 4.2.0, PHP 5) var_export--输出或返回一个变量的字符串表示 描述 mixed var_export ( mixed expression [, bool return] ) 此函数返回关于传递给该函数的变量的结构信息,它和 var_dump() 类似

日期:10-01-09 09:42 地址重写规则

RewriteCond %{REQUEST_URI} !\.(js|ico|gif|jpg|jpeg|swf|bmp|png|css|php|html|htm)$ RewriteRule ^(.*)$ /index.php/$1

日期:10-01-04 10:02 Dis_cuz7.0、Ucenter1.5登陆无法同步

修改论坛目录下面fourmdata/cache/cache_settings.php文件 找到'allowsynlogin'=0修改为 'allowsynlogin'=1就可以了。 修改论坛目录下面fourmdata/cache/cache_setting.php文件 找到'allowsynlogin'=0修改为 'allowsynlog
掂量
  • friend
会员等级: 高级会员
会员积分: 10003 分
空间访问: 510 次

更多我的资料

  • 昵称:掂量
  • 性别:男
  • 最后登录:03-19 06:11

我的网址书签

最近访客