This forum is now read-only. Please use our new forums at

Functions, Part I Forum

View Course

47 points
Submitted by
about 2 years ago

Hi Stuck with this one can someone help?

// Use rand() to print a random number to the screen

print rand(0,7);

// Use your knowledge of strlen(), substr(), and rand() to
// print a random character from your name to the screen.
print $length;
print rand (0,$length);
$partial = substr($name,$lenght,$lenght);
print $partial;

print $answer;



This is my version but I simply can't figure out how to pick a random letter from my name
Can someone write the code solution to this?
Thanks a lot

0 votes


Hi Michael, I found this post pretty helpful:

292 points
Submitted by
about 2 years ago