a format of unique string to be generated in php
function generateRandomString($length = 25) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
//usage
$myRandomString = generateRandomString(5);<?php
// online code for creating alphanumeric in php
// this will generate 6 charactor, you can create as many just change the 6 from code
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyz"), 0, 6);
echo $pass;
//output : 17w2y8
?>
Also in PHP:
- $dbh = new PDO("mysql:host
- capital letter php
- find location from an ip address PHP
- date reformat php
- char uppercase php
- contains functin php
- PHP string mask day-year
- check length of a string in php
- PHP Fatal error: Uncaught Error: Class 'IntlDateFormatter' not found in /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
- Laravel Eloquent, group by month/year
- WooCommerce Add Long Description to Products on Shop Page with Character limit
- display all files in a directory php
- android studio clear cache
- check if table exists sql php
- delete cache manually laravel 5
- defaultStringLength laravel
- Error: Cannot redeclare composerRequire1d8e02dff94f518b7a14ddcb6710f10d() (previously declared in /Applications/XAMPP/xamppfiles/htdocs/all4learn2/Vendor/composer/autoload_real.php:66)
- error log display
- check if string contain element php
- create child theme in wordpress
- check if key of array key true or false php
- convert lower to upper case php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/Users/USER/composer/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- Allowed memory size of 1610612736 bytes exhausted