creare a random string 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
$random = substr(md5(mt_rand()), 0, 7);
echo $random;
?>
Also in PHP:
- check if cookie exists php
- check if array has value php
- Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5" laravel
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/service.ramondettiforwarding.com/lib/vendor/guzzlehttp/guzzle/src/Middleware.php on line 3432184904
- create foreign key laravel migration
- combine two query value in laravel 8
- STATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
- WooCommerce Add Long Description to Products on Shop Page with Character limit
- display all errors php
- datetime default format hour format ph
- debugger for php
- adding spasifc date to date('Y-m-d H:i:s') php
- current timestamp with sec in php to strstring
- file_get_contents php ssl
- buscar un substring dentro de un string php
- base64 dencode GET variables in PHP
- composer create laravel
- check installed php modules in linux
- Schema::defaultStringLength(191)
- current date & tie in php
- No match for argument: phpmyadmin yum
- THROW EXPECTION PHP
- afficher la date en php
- Adding or Subtracting Time