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}'";

相关文章:

  • 2021-11-20
  • 2021-07-16
  • 2022-03-05
  • 2021-05-20
猜你喜欢
  • 2021-10-10
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案