Another newbie questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pastijalan
Forum Newbie
Posts: 10
Joined: Thu Oct 12, 2006 11:54 pm

Another newbie questions

Post by pastijalan »

Another newbie questions :oops: . How does

function createURL($page = '', $ending = '')

differ from

function createURL($page, $ending)

Thx!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Another newbie questions

Post by Luke »

pastijalan wrote:Another newbie questions :oops: . How does

function createURL($page = '', $ending = '')

differ from

function createURL($page, $ending)

Thx!
The first one defines a function with two parameters with defaults of an empty string. So, you can call that particular function without supplying it the arguments, and it will just use the defaults.

The second one does not provide defaults, so it would require that you supply the necessary arguments
pastijalan
Forum Newbie
Posts: 10
Joined: Thu Oct 12, 2006 11:54 pm

Post by pastijalan »

Thx Ninja!
Post Reply