1. Home
  2. Docs
  3. Function Reference
  4. Functions
  5. unique_code_fn()

unique_code_fn()

Generate a unique code.

Copy to Clipboard

Parameters

$chars_int

Total number of characters (default 8)

$table_str

Data table name

$col_str

Data table column name

$numOnly_str

If true, use numbers only. Otherwise use random characters (default false)

$format_arr

Use to format the unique code. For example, to insert a dash every 4 digits:

Copy to Clipboard

$echoQuery_bln

If true the query will be echoed out (default false)

Return

string

The unique code

Example

Copy to Clipboard

Location

This function can be found here: