create random string using php
<?php
function RandomString()
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randstring = '';
for ($i = 0; $i < 10; $i++) {
$randstring = $characters[rand(0, strlen($characters))];
}
return $randstring;
}
RandomString();
echo $randstring;//generates 13 character random unique alphanumeric id
echo uniqid();
//output - 5e6d873a4f597
Also in PHP:
- check if array contains a key php
- add more data to variable php
- echo gettype
- Variable 'sql_mode' can't be set to the value of 'REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( @@sql_mode'</p><p>SELECT * FROM `users` WHERE `username` = 'yth19203' ORDER BY `id` DESC</p><p>Filename: models/Crud.php</p><p>Line Number: 92</p> </div>
- echo in json format php
- 5 examples of exception handling in php
- convert timestamp php
- /phpspreadsheet 1.15.0 requires ext-dom * centos
- Throw new error php
- find position of character in string php
- echo json php
- auto generated password in php
- Argument 1 passed to NotORM_Result::update() must be of the type array, string php slim
- all capital in php
- contains in php string
- 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php
- convert unix timestamp to datetime php twig
- css adding corner
- echo err in php
- char to uppercase php
- dates phpp
- datetime mysql php
- cache:clear artisan laravel
- chrome see php echo