echo ('john'.'_'.str_replace('.',time(),microtime()*rand()));
i am using php laravel 5.5 and my php version is 7.2
Also I have tried:
composer update
and:
composer update symfony/var-dumper
but the problem still occurs.
echo ('john'.'_'.str_replace('.',time(),microtime()*rand()));
i am using php laravel 5.5 and my php version is 7.2
Also I have tried:
composer update
and:
composer update symfony/var-dumper
but the problem still occurs.
Problem is appears in microtime()
. It returns something like 0.13685800 1522584183
. There is space among of them. Because of this product of microtime()
and *rand()
can't be calculated.
You must get first or second part of microtime()
:
For first part:
echo ('john'.'_'.str_replace('.',time(),explode(' ',microtime())[1]*rand()));
For second part:
echo ('john'.'_'.str_replace('.',time(),explode(' ',microtime())[2]*rand()));
explode()
function splits string to 2 part and return this parts as array.