PHP Classes

PHP Generate Unique ID from String: Generate unique identifier strings

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 64%Total: 245 All time: 7,984 This week: 673Up
Version License PHP version Categories
generate-id 1.0.0GNU General Publi...5PHP 5, Text processing
Description 

Author

This class can generate unique identifier strings.

It can take as parameters string prefix, an id number and a given string length.

The class combines the prefix and the ID number and generates a string with the given length if necessary padding the id number with zeros.

Picture of Rongala Prasad
  Performance   Level  
Name: Rongala Prasad <contact>
Classes: 1 package by
Country: India India
Age: 31
All time rank: 4000274 in India India
Week rank: 321 Up22 in India India Up

Example

<?php

require_once "GenerateID.php";

$genid = new GenerateID();
$genid->setPrefix("CUST");
$genid->setMaxLength(4);
$genid->setId(123);
echo
$genid->generate();


  Files folder image Files  
File Role Description
Plain text file example.php Example Example file
Plain text file GenerateID.php Class GenerateID class file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:245
This week:0
All time:7,984
This week:673Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:-
Examples:91%StarStarStarStarStar
Tests:-
Videos:-
Overall:64%StarStarStarStar
Rank:745