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

Functions, Part I Forum

View Course » View Exercise

1151 points
54fd9dc095e37890120042da_47343003
Submitted by
Natalie
about 2 years ago

Why isn't it working?

Hello everybody,
I want to ask something about the exercise "String Functions I". I tried perceived hundred of times different codes and I guess my fault is something really stupid, but I don't understand why the server does not except my code. It prints exactly what the instructions told me to print.

Please! Can somebody help me?

alt text


-2 votes

permalink

I think you have to use "print" instead of "echo". This code worked for me:

<?php
// Get a partial string from within your own name
// and print it to the screen!
$myname = "Matt";

$partial = substr($myname, 0, 2);
print $partial
?>

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


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

1578 points
54a1deaf51b8879c77015008_802418678
Submitted by
Matt Anderson
about 2 years ago

1 Comment

54fd9dc095e37890120042da_47343003 Natalie about 2 years ago

Thank you really much, even if this didn't work for me, I found my problem^^