php8.5
Home/ Manual/ mysql_xdevapi / session/ Session::generateUUID

Session::generateUUID

PHP function Edit on GitHub ✎

Get new UUID

Description

mysql_xdevapi\Session::generateUUID(): string

Generate a Universal Unique IDentifier (UUID) generated according to RFC 4122.

Parameters Parameters

Return Values

The UUID; a string with a length of 32.

Examples

mysql_xdevapi\Session::generateUuid() example

php
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");

$uuid = $session->generateUuid();

var_dump($uuid);

The above example will output something similar to:

output
string(32) "484B18AC7980F8D4FE84613CDA5EE84B"

Source: reference/mysql_xdevapi/mysql_xdevapi/session/generateuuid.xml · from the official PHP manual (php/doc-en)