How to Create user unique id in php with higest percent of uniquness

I have tried to create a user unique id, will it be unique or give trouble in the future?Please help. There are two functions.Need your guidance as I am a beginner

First one

    private function generate_uuid() {
   return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
       mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
       mt_rand( 0, 0xffff ),
       mt_rand( 0, 0x0fff ) | 0x4000,
       mt_rand( 0, 0x3fff ) | 0x8000,
       mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
   );
}

Second One

private function generateCustomerID() {
    return sprintf('CUID%07d', mt_rand(1, 9999999));
}