Whats wrong with my code?


#1

https://www.codecademy.com/courses/web-beginner-en-7I7Xm/0/2?curriculum_id=5124ef4c78d510dd89003eb8

<?php
 $myname = "Eric";
 // Get a partial string from within your own name
 // and print it to the screen!
 $partial = substr($myname, 0, 3);
 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($myname);
 print $lowercase;
 ?>
.

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

output
Eri ERIC eric


#2

write the same code inside <p> </p> tag

<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 got this error
Oops, try again. Did you remember to print your name in UPPERCASE?


//


<?php
$myname = "Eric";
// Get a partial string from within your own name
// and print it to the screen!
$partial = substr($myname, 0, 3);
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($myname);
print $lowercase;
?>

//


#4

where is your <p>  </p> tag

your code should like...........

<html>
  <p>
 <?php
  $myname = "Eric";
  // Get a partial string from within your own name
  // and print it to the screen!
   $partial = substr($myname, 0, 3);
   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>

#5


#6

need 3 <p> </p> tag you have one

#7

Thanksss its solved...........


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.