All pastes #139672 Raw Edit

Stuff

public text v1 · immutable
#139672 ·published 2006-08-20 02:27 UTC
rendered paste body
function alternate(&$a, $b)
{
  return($a = $a?$a:$b);
}

/* One of my popular variations */
function Nalternate(&$a, $b)
{
  return($a = is_integer($a)?$a:$b);
}


function table_yourway($width, $border, $cellpadding, $cellspacing)
{
  $width = $width ? $width : '100%';
  $border = is_integer($border) ? $border : 1;
  $cellpadding = is_integer($cellpadding) ? $cellpadding : 1;
  $cellspacing = is_integer($cellspacing) ? $cellspacing : $cellpadding;
}

function table_myway($width, $border, $cellpadding, $cellspacing)
{
  alternate($width, '100%');
  Nalternate($border, 1);
  Nalternate($cellpadding, 1);
  Nalternate($cellspacing, $cellpadding);
}