如何从codeigniter中的spl_object_hash()函数生成唯一ID?
我有一个客户表,我需要手动为每个客户生成唯一的id,而不是在mysql中自动递增。如何做到这一点?有人建议我使用如何从codeigniter中的spl_object_hash()函数生成唯一ID?,codeigniter,Codeigniter,我有一个客户表,我需要手动为每个客户生成唯一的id,而不是在mysql中自动递增。如何做到这一点?有人建议我使用uniqid(md5(spl_object_hash($custApp)),false)编写下面的代码功能: $data = file_get_contents("php://input"); $custApp = json_decode(base64_decode($data)); $custApp->Id = uniqid(md5(spl_object_hash($cus
uniqid(md5(spl_object_hash($custApp)),false)编写下面的代码代码>功能:
$data = file_get_contents("php://input");
$custApp = json_decode(base64_decode($data));
$custApp->Id = uniqid(md5(spl_object_hash($custApp)), false);
但是我不知道如何在我的代码中使用这个函数使用sha1($nombre_-customer)
并保存您的id如何唯一(time()
是最佳唯一值$nombre_-customer变量是什么?