This is about Math Functions II. I really don't understand why I keep getting the error "Oops, try again. The random output you printed from your name should be just one character". Any help would be greatly appreciated. Oh, and by thew way, I use $randC = round(rand(0, $length-1)); because it simply won't accept $randC = rand(0, $length-1); => it'll keep giving me the error " Oops, try again. Your printed output from rand() should be an integer."
<html> <p> <?php // Use rand() to print a random number to the screen print rand(); ?> </p> <p> <?php // Use your knowledge of strlen(), substr(), and rand() to // print a random character from your name to the screen. $name = "stefan"; $length = strlen($name); echo "<p>Chosen name has " . $length . " characters.</p>"; $randC = round(rand(0, $length-1)); echo "<p>Random character is character associated with string position no. " . $randC . ".</p>"; $result = substr($name, $randC, 1); print $result; ?> </p> </html>