If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.
Register Today on DNForum IT'S FREE!Does PHP support overloaded functions?
This is very handy in C/C++...
I wrote a script with overloaded functions, but but I get an error when trying to run it.
Just curious if anybody know the definitive answer.
-Bob
. . .
bob, no overloaded functions in PHP, but you can use "defaults"
function hello($var1,$var2='hi'){
if($var2=="hi") print "hello:";
print $var1;
}
hello('dude'); prints "hello: dude"
hello('dude','hi'); prints "hello: dude"
hello('dude','something'); prints "dude"
Bookmarks