I am trying to make this variable equal to the user id and then a random integer that comes straight after the user id. How would I do this as my code doesn't seem to work?
$parentid = $_SESSION['user_name'] + rand();
Thanks
I am trying to make this variable equal to the user id and then a random integer that comes straight after the user id. How would I do this as my code doesn't seem to work?
$parentid = $_SESSION['user_name'] + rand();
Thanks
For a more "strict" guideline, you could use sprintf
or str_replace()
$parentid = sprintf('%s%d', $_SESSION['username'], rand());