Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

print("<FONT COLOR=\"$Color\">$Text");
}


printColored("This is black text");
print("
\n");


printColored("This is blue text", "blue");
print("
\n");
?>


Listing 4.5 Using unset with a Default Argument


You might wonder why you'd ever want to pull arguments out using the functions
mentioned above instead of naming them in the declaration. It's possible that you do not
know how many arguments you will be given. Consider a function that creates a list,
given any number of items. You could first place those items in an array, then pass the

Free download pdf