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

Functions, Part I Forum

View Course » View Exercise

949 points
Submitted by
Kiana Ward
over 3 years ago

Did you print your name in uppercase?

So I think my code is right but it comes back saying that i haven't printed in uppercase although it is showing. My code is below, please help.


// Get a partial string from within your own name
// and print it to the screen!
$myname = "leigh";
$partial = substr($myname, 0, 3);
print $partial;

// Make your name upper case and print it to the screen:
$myname = "leigh";
$upper = strtoupper ($myname);
print $upper;

// Make your name lower case and print it to the screen:
$myname = "leigh";
$lower = strtolower ($myname);
print $lower;

1 vote


i have a suspicion...
what happens, if you rename your variable to $myName (with capital N).

maybe the checking cannot recognize/ accept the var name as is.

btw: no need to declare/ set $myName three times. do it in the first PHP-block. afaik the variable lives on. its scope is not limited to within one <?php ... ?> segment

565 points
Submitted by
over 3 years ago