Exercise: Functions, Part I, Math Functions II
Task: Print a random character from your name.
I have tried simplifying this and printing every component for over four hours
The output is correct but still getting an error message:
"Oops, try again. The random output you printed from your name should be just one character."
$name = "peter";
$max = strlen ("$name") - 1; //Max output including 0
$rand = rand (0, $max);
$output = substr ("$name", $rand, 1); //string, start, length
// or echo substr ("$name", rand (0, strlen ("$name"-1)), 1);