7. Functions, Part I error


#1


I don't know what the problem is but whenever I try to submit an error appears saying 'Oops, try again. Did you remember to print your name in UPPERCASE?'.
However I have done that and the program does work.

Thankyou to anybody who helps!


<html>
<p>
<?php
// Get a partial string from within your own name
// and print it to the screen!
$name = "Leah";
echo $name;
$sub =substr($name,0,3);
//echo $sub;
?>

<?php
// Make your name upper case and print it to the screen:
$upper = strtoupper($name);
echo $upper;
?>

<?php
// Make your name lower case and print it to the screen:
$lower=strtolower($name);
echo $lower;
?>
</p>
</html>


#2

Maybe print your $sub first or refresh the page and try again.


#3

It worked when I use print instead of echo


#4

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