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

Functions, Part I Forum

View Course » View Exercise

746 points
54b3f61295e378f86d008842_68761315
Submitted by
Riley Moos
almost 3 years ago

2/8 Could someone help please?

Could someone please explain me how to do this because I did what it asked me to do but it didnt work so im not understanding something?

Heres what I put.


<?php
$myname = "Riley Moos";
$partial = substr($myname, 0, 3);
echo $partial;

?>

<?php
$uppercase = strtoupper($myname);
echo $uppercase;
?>


<?php
$lowercase = strtolower($myname);
echo $lowercase;
?>


-4 votes

permalink

<?php
// Get a partial string from within your own name
// and print it to the screen!
echo substr("Menixator",3);
?>


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


<?php
// Make your name lower case and print it to the screen:
echo strtolower("MENIXATOR");
?>

746 points
54b3f61295e378f86d008842_68761315
Submitted by
Riley Moos
over 2 years ago


-5 votes

permalink

Use print :)?
My code below for you;
<?php
$part = substr("Robin", 0,3);
print $part;

    ?>
  </p>
  <p>
    <?php
    $upper = strtoupper("Robin");
    print $upper;

    ?>
  </p>
  <p>
    <?php
   $lower = strtolower("Robin");
   print $lower;

    ?>

450 points
5240e713abf821aa28001257_703076796
Submitted by
Robinvb
almost 3 years ago

2 Comments

54b3f61295e378f86d008842_68761315 Riley Moos over 2 years ago

Oops, try again. Did you remember to print your name in lowercase?

54b946c386f552a3880060c3_940717212 danielper over 2 years ago

Yes, it doesn't work D: