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

Functions, Part I Forum

View Course » View Exercise

472 points
15cb9219d567f8bf6af17ca15641dbde?s=140&d=retro
Submitted by
Thomas
about 3 years ago

My code is right but does not work :(

This is my code.
*

<?php
// Get the length of your own name
// and print it to the screen!
$length = strlen("Thomas");
print $length;

?>

**
IT should work but it does not; it comes up with this. Oops, try again. Did you remember to use strlen() in your code?


2 votes

Best answer

permalink

Solved, although the example says use print it only works with echo..

472 points
15cb9219d567f8bf6af17ca15641dbde?s=140&d=retro
Submitted by
Thomas
about 3 years ago

1 Comment

543fc82f631fe988640020d7_382532424 Tobias Páez over 2 years ago

$length = strlen("Thomas");
echo $length;

0 votes

permalink

Hello Thomas you can use both print and echo to output your result

365 points
543fc82f631fe988640020d7_382532424
Submitted by
Tobias Páez
over 2 years ago