Since I am still new to PHP, I am looking for a way to find out how to get a specific character from a string.
Example:
$word = \"master\"; $length =
Try this simply:
$word = "master"; $length = strlen($word); $random = rand(0,$length-1); if($word[$random] == 's'){ echo $word[$random]; }
Here I used 0 because $word[0] is m so that we need to subtract one from strlen($word) for getting last character r
$word[0]
m
strlen($word)
r