Somebody please help me,i dont know whats error in my code


#1

Hi guys,
I can't solve this exercise.

I think everything's ok, I can see the printed words on the right but when i click on save and submit this message appears : Oops, try again. Did you remember to print your substring

Replace this line with your code. 
<html>
  <p>
    <?php
    // Get a partial string from within your own name
    // and print it to the screen!

    ?>
  </p>
  <p>
    <?php
      $myname = "mhnptr";
    $partial = substr($myname, 0, 2);
print $partial;
    ?>
  </p>
  <p>
    <?php
    // Make your name lower case and print it to the screen:
    $uppercase = strtoupper($myname);
    print $uppercase;
    $lowercase = strtolower($myname);
    print $lowercase;
       
    ?>  
  </p>
</html>


who know the mistakes please tell me :sob:


#2

Hey @mhnptr,
you have to put your code where it has to be. That's often the problem, why a code
- even if its syntax is correct - won't run.

Try this:

<html>
  <p>
    <?php
    // Get a partial string from within your own name
    // and print it to the screen!
    $myname = "mhnptr";
    
    $partial = substr($myname, 0, 2);
    print $partial;
    ?>
  </p>
  <p>
    <?php
    // Make your name upper case and print it to the screen:
    $uppercase = strtoupper($myname);
    print $uppercase;
    ?>
  </p>
  <p>
    <?php
    // Make your name lower case and print it to the screen:
    $lowercase = strtolower($myname);
    print $lowercase;
    ?>
  </p>
</html>

Hope that I could help you :slight_smile:


#3

thank you so much @0xb4dc0ded