Hello,

I saw a part of code in a script like that:
function ($first_name = ' ')
what does it mean ?
why is it blank ?
why not just write:
function ($first_name)
or
function ($first_name = NULL)

?

Comments

By given an argument a value

By given an argument a value you make it optional (as long as all arguments after also have values).

The value one gives it is up to the function designer/writer.

That's called a default

That's called a default argument value. So if someone calls your function without passing any arguments, $first_name will still default to an empty string ''. See http://us1.php.net/manual/en/functions.arguments.php#functions.arguments... for more info.

$first_name = NULL would work about the same, but for strings it's a little clearer to default to empty ''.