Please help to do this


#1

Hi , can you please do this homework , sometimes I cant do some coding until I watch it and learn . here is homework : Use your knowledge of strlen(), substr(), and rand() to print a random character from your name to the screen.


#2

Try this!



<?php
// Use rand() to print a random number to the screen
print rand();
?>



<?php
// Use your knowledge of strlen(), substr(), and rand() to
// print a random character from your name to the screen.
$name = "pipeo";
$nameLen = strlen($name);
print substr($name, rand(0, $nameLen)-1, 1);
?>