function get_hash_table($table,$uid){
$_str = crc32($uid);
if($_str < 0 ){
$ret = "0".substr(abs($_str),0,1);
}else{
$ret = substr($_str,0,2);
}
return $table."_".$ret;
} echo get_hash_table('test','user1'); //test_01
echo get_hash_table('test','ddddaaaa'); //test_10
调用方式 "select * from ".get_hash_table('user', $uid)." where userid = '{$uid}'";