Horje
laravel random string Code Example
laravel random string
use Illuminate\Support\Str;

$random = Str::random(40);
Source: laravel.com
PHP random string generator
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 string
function rand_str() {
    $characters = '0123456789-=+{}[]:;@#~.?/&gt;,&lt;|\!"£$%^&amp;*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $randomstr = '';
    for ($i = 0; $i < random_int(50, 100); $i++) {
      $randomstr .= $characters[rand(0, strlen($characters) - 1)];
    }
    return $randomstr;
  }
random string value laravel
//select random value from array
use Illuminate\Support\Arr;

$array = [1, 2, 3, 4, 5];

$random = Arr::random($array);


//generate random string of specific length
use Illuminate\Support\Str;

$random = Str::random(40);
Source: laravel.com




Php

Related
wordpress max memory limit Code Example wordpress max memory limit Code Example
Class "App\Http\Controllers\Auth" not found Code Example Class "App\Http\Controllers\Auth" not found Code Example
php redirect in seconds Code Example php redirect in seconds Code Example
get start of month end of month  carbon Code Example get start of month end of month carbon Code Example
php 0 padding left Code Example php 0 padding left Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
14