I need to generate a random string to use as part of a URL.
I am using laravel 5.6 and currently doing this:
$url = '/controller/' . str_slug(str_random(8)) . '/review';
and I am wondering if I actually need the overhead of str_slug(). I can not seem to find anything that indicates if str_random() produces URL safe strings or not.
Aucun commentaire:
Enregistrer un commentaire