This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by David Munday
about 11 years

Whats wrong with my code?

    function displayName("David"); {
        echo displayName();
    }

Answer 51530a54876698de45000855

4 votes

Permalink

You’re giving the function your name as a parameter, then you call the function without any parameter inside your function… It’s not necessary to give it any parameter. You are supposed to just echo your name the body of the function. Like this:

    function displayName() {
        echo "astenbak";
    }
points
Submitted by Arild Stenbæk
about 11 years

2 comments

David Munday about 11 years

ok cheers :)

Dujon almost 11 years

nope i get this:: PHP Fatal error: Cannot redeclare displayName() (previously declared in /root/adapter/runners/runner.php(58) : eval()’d code:11) in /root/adapter/runners/runner.php(58) : eval()’d code on line 12