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

Functions, Part I Forum

View Course » View Exercise

389 points
553f9f6995e378b349000465_126824229
Submitted by
Danielle Platt
almost 2 years ago

"Oops, try again. Did you remember to print your substring?" bug?

Am I doing something wrong or is this just a bug? I tried to echo $partial; but that didn't work either:

<?php

    $myname = "Danielle";
    $partial = substr($myname, 0, 3);
    print $partial;

    $uppercase = strtoupper($myname);
    echo $uppercase;

    $lowercase = strtolower($myname);
    echo $lowercase;

    ?>

1 vote

permalink

Hi,

why did you remove the <p> </p> tags?
Try this and it should work:

<p>
<?php
    $myname = "Danielle";
    $partial = substr($myname, 0, 3);
    print $partial;
?></p>
<p>
<?php
    $uppercase = strtoupper($myname);
    echo $uppercase;
?></p>
<p>
<?php
    $lowercase = strtolower($myname);
    echo $lowercase;
?>
</p>

1409 points
588b2ac3e1281365f0000133_918398059
Submitted by
Codmakr
almost 2 years ago