How can i add a single random character (0-9 or a-z or - or _) at a random place in a string.
I can get the random position by following:
$random_position = rand(0,5);
Now How can i get a random number ( 0 to 9 ) OR random character (a to z) OR (-) OR (_)
and finally how i can add character to the above string in the above random position.
For example following is string:
$string = "abc123";
$random_position = 2;
$random_char = "_";
the new string should be:
"a_bc123"