hi, I just need a function that will check some variables and if they empty it will give vairables value '-----'.
here is my code
function checkdefault($addr2,$state,$postcode){
if($addr2==''){
$addr2='-----';
}
return $addr2;
if($state==''){
$state='-----';
}
return $state;
if($postcode==''){
$postode='-----';
}
return $postcode;
}
And I use the following code to display this variables
$addr2=checkdefault($addr2,$state,$postcode);
$state=checkdefault($addr2,$state,$postcode);
$postcode=checkdefault($addr2,$state,$postcode);
Is there better way to do this..I mean I just need $addr2,$state,$postcode variables..so I can print at any place.if they empty their values will be '-----'
thanks in advance.