Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions components/uid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,14 @@ ULID objects created with the ``Ulid`` class can use the following methods::
// checking if a given value is valid as ULID
$isValid = Ulid::isValid($ulidValue); // true or false

// validating ULIDs in a specific format
$isValid = Ulid::isValid($ulidValue, Ulid::FORMAT_BASE_32);
$isValid = Ulid::isValid($ulidValue, Ulid::FORMAT_RFC_4122);

By default, ``Ulid::isValid()`` validates ULIDs in the canonical Base32 format.
Use the optional ``$format`` argument to validate ULIDs in other representations,
such as RFC 4122, binary or Base58 formats.

// getting the ULID datetime
$ulid1->getDateTime(); // returns a \DateTimeImmutable instance

Expand Down
Loading