0

Lets say I have this code:

<?php 
function sayHello($forename = 'John', $lastname = 'doe') {
    return 'Hello '.$forename . ' ' . $lastname;
}
?>

if I call this function like:

sayHello();

it returns

Hello John doe

but what if my first name is correct and I want to change only my lastname?

I can't do this:

sayHello(,,'lastname')

is there a way to leave the firstname alone and only change the lastname?

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.