We will need the three tools you have learned in this lesson.
Given a name,
$name = "Wee Gillis";
Let’s say we want the fifth letter, bearing in mind zero-indexing of strings…
$char = substr($name, 4, 1); // -> G
Now replace the
4 with the random code to get a letter from your name.
rand(0, strlen($name) - 1)