Where exactly is the issue in the code?


#1

Hey all ,

In the same exercise , im using this code:-

<?php
print rand();//Everything what we must do to
//solve this, is ONLY INSERT 'PRINT' to
//this place!!!

//And the rest of code is unchanged:
?>
</p>
<p>
<?php    
$name = "Dhanush Rajendra";
$namelength = strlen($name);
print substr($name, rand(0, $namelength - 1), 1);
?>

So , when i execute it . This shows up "Oops, try again. Your printed output from rand() should be an integer."

So where exactly is the issue in the code?


Functions, Part I: 5. Math Functions II --- rand() output should be an integer error?
#2

Try setting a range argument,

print rand(1,10);

Tags are in reverse. The PHP will be inserted into the element:

<p>
<?php

?>
</p>

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.