Functions, Part I - Receiving error even though the code and the output is correct


#1

I'm trying to finish Functions, Part I, however I'm stuck on an exercise which makes no sense. I've fulfilled the requirements and everything is correct, yet I still get an error.

I attached a print screen of the problem.


#2

Hi your code should be inside

<html>
  <p>
    <?php
    // Get a partial string from within your own name
    // and print it to the screen!

    ?>
  </p>
  <p>
    <?php
    // Make your name upper case and print it to the screen:
    
    ?>
  </p>
  <p>
    <?php
    // Make your name lower case and print it to the screen:
    
    ?>
  </p>
</html>

#3

I have the exact code that you had, and I keep getting a error message that says: "Your output for strtoupper() should be entirely upper case letters.". :cry: Can someone please help?


#4

HI can you post your code?


#5

Sure, it's:



<?php
// Get a partial string from within your own name
// and print it to the screen!
print strtolower("Renata");
?>



<?php
// Make your name upper case and print it to the screen:
print substr("renata", 0, 3);
?>



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



#6

first you should put each function where it should be like that

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

<?php
// Make your name upper case and print it to the screen:
print strtoupper("renata");
?>
<?php
// Make your name lower case and print it to the screen:
print strtolower("Renata");
?>

then you should put them inside

<html>
  <p>

    // Get a partial string from within your own name
    // and print it to the screen!


  </p>
  <p>

    // Make your name upper case and print it to the screen:
    

  </p>
  <p>

    // Make your name lower case and print it to the screen:
    

  </p>
</html>

you should have the <p></p> tag around them


#7

Wait, I put them in the wrong order! I just made a mistake!