Welcome to Learn tech tips Channel - I am Zidane. (nick name is ιθ). This topic is share with you guy How to gen a license key in software program use PHP programming language. If you want to
gen license key in your program, you can easy do it in PHP by follow my below guide
I had implement some code, you can check it out for detail.
Explore My Other Channel for More Cool and Valuable Insights
Youtube Learn Tech Tipsπ Tiktok
π Facebook:Using array in PHP for stored alphabet character.
Using rand API for random number from 0 to 25. We have 26 Alphabet, so we should random from 0 to 25
// ---------------------------------------------------------------------
// Developers: zidane (huuvi168@gmail.com)
// Last Modified: 2015-09-08
// ---------------------------------------------------------------------
function randomAlphabet()
{
$val = rand(0, 25);
$alphabet = array("A","B","C","D", "E",
"F","G","H","I", "J",
"K","L","M","N", "O",
"P","Q","R","S", "T",
"U","V","W","X", "Y",
"Z");
return ($alphabet[$val]);
}
function createKey($nNum)
{
// L"MAGEC-RSTUV-EODVZ-RRKXS-SLPQS-FVW0N-CCTJA-ILWSO";
$szMsg = "";
for ($i=0; $i < $nNum; $i++)
{
if ($i == 4 || $i == 9 || $i == 14 || $i == 19 || $i == 24 ||
$i == 29 || $i == 34)
$szMsg .= "-";
$szMsg .= randomAlphabet();
}
print $szMsg;
}
createKey(40);
Output
QCLQS-UDQEY-YZOGU-FGZQF-SUYNE-YCBXC-RIUOX-GSZDJ
Thank you for reading this post. I hope you found it helpful and easy to follow. If you have any feedback or questions about
How to make a example gen License Key in program using PHP ,
please share them in the comments below. I would love to hear from you and discuss this topic further
✋✋✋✋
Webzone Tech Tips Zidane, all things tech tips web development
- I am Zidane, See you next time soon ✋✋✋✋