02-27-2008, 06:32 PM
|
#9 (permalink)
|
|
The Contributor
Join Date: Feb 2008
Location: Croatia
Posts: 90
Thanks: 4
|
It is a good solution in Python, but if you want this in PHP you're good to go with arrays like Alan said.
Also the same thing could be used in Javascript for defining some atribute (Umm - Prototype -
Code:
Effect.toggle( 'id', 'effect', {'duration':'1'} );
Like you said your function
Code:
function textDecoration( $font, $size, $underlined = false, $strikethrough = false );
PHP Code:
function textDecoration ( $fontOption, $styleOption );
// -->
function textDecoration( array( 'font' => 'Arial',
'size' => '12'
), array( 'underlined' ) );
so you just check if size isn't specified - you set the default value for it.
If underlined specified - underline, if not - don't.
I mean you get the picture.
Hope I helped.
Thanx to Alan :)
__________________
Back from sysadmins to the programmers.
|
|
|