create random alphanumeric 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);
Also in PHP:
- check array has key data
- decode a nested JSON with php
- data validation of $_POST in php
- Allowed memory size of 1610612736 bytes exhausted laravel 8
- Arr::get laravel
- Modularizing laravel 8.0
- Customer::insert([ 'customer_name' => $request->customer name, 'customer mobile'=> $request->customer mobile, 'user_id'=>Auth::user()->id, 'created_at'=> Carbon::now() ]);
- error reporting php
- delete in wordpress query
- PHP DateTime ->format
- fetch today data in php
- failed to open stream: no such file or directory php
- composer set php version
- find index of a charachter charachrer isn string phph
- echo json php
- create migration table in php
- composer which php version
- date('c') php
- count length of a string
- cache get laravel
- Method Illuminate\Database\Eloquent\Collection::save does not exist.
- clear cache locally laravel
- datephp
- basd64 decrtpy php