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

Functions, Part II Forum

View Course » View Exercise

701 points
51608dfc1b67dc7988001422_849031298
Submitted by
Eliheyder Qubatov
about 4 years ago

Oops, try again! It looks like your function doesn't echo or print anything!

What's wrong in this code:




<?php
function displayName() {
print "Eliheyder";
}
displayName();

?>
</body>

6 votes

permalink

I used print_r instead of print, and strangely, it helped

    function displayName() {
        print_r ("Dmitriy");
    }

498 points
2bf795186618f42fa0853e9c4cddf349?s=140&d=retro
Submitted by
V3N0m21
about 4 years ago

2 Comments

5f590cb295c3083b8a119f61aa73c201?s=140&d=retro Naxxos84 about 4 years ago

this really helps... eventhough i don't knwo why :D

5246c1b2f10c60f324002e4c_482475389 Yee Joo almost 4 years ago

thanks...


3 votes

permalink

There you got good code . Jacob you forgot puted the semicole after "print "Jake"; }:".

<?php
// Write your function below!
function displayName(){
echo "Patryk";
};
displayName();

    ?>
  </p>
</body>

780 points
5197fd9d8ffc0ba39d0006d2_879767769
Submitted by
optymalnyX
about 4 years ago


1 vote

permalink

I have a same problem. And would like to have answer too...

answer here

722 points
51b8ce2152f863f9640003ce_480084217
Submitted by
Oleg Bodyansky
about 4 years ago


1 vote

permalink

I have found answer.1 refresh the page;2 reset code;3copy the hint;4 paste and edit the hint;(I am sorry for grammatic errors.My english is not good :( )

701 points
51608dfc1b67dc7988001422_849031298
Submitted by
Eliheyder Qubatov
about 4 years ago

1 Comment

Picture Cameron McIntyre about 4 years ago

Thank you! This worked perfectly


-2 votes

permalink

I ALSO have the same problem:
<?php
function displayName() {
print "Jake";
}
displayName();
?>

346 points
582f5e392524c84fad0003c2_338490890
Submitted by
Jacob Tooman
about 4 years ago