So working on the functions part I exercise, the one where it asks you to print the random value of the position in a string. Okay straight forward. Need to think out the approach, but nothing major.
Step 1: declare a string:
$name = "my name";
step 2: find the length of the string:
$length = strlen($name);
step 3: find a random position from the length
$pos = rand(0, $length);
step 4, print that value:
so finished code:
$name = "MyName"; $length = strlen($name); $pos = rand(0, $length); print $pos; ?>
And the response I get from the system is:
"Oops, try again. The random output you printed from your name should be just one character. "
um.... well it IS one character. So... what am I doing wrong?