Skip to content

Instantly share code, notes, and snippets.

@LasseRafn
Created January 22, 2017 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LasseRafn/7454161a43db43a77637844becd9575b to your computer and use it in GitHub Desktop.
Save LasseRafn/7454161a43db43a77637844becd9575b to your computer and use it in GitHub Desktop.
<?php
class UniqueId {
private $id;
public function __construct($prefix = '')
{
$this->id = uniqid($prefix, true);
}
public function __toString()
{
return $this->id;
}
}
// Usage:
$profile->unique_id = (string) new UniqueId();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment