Omzy Posted January 1, 2009 Share Posted January 1, 2009 Here is my current address string: $address=$address1.", ".$address2.", ".$district.", ".$town.", ".$county.", ".$postcode; The problem is sometimes a client does not provide an 'address2' or 'district', in some cases both are not provided in which case the address string has unnecessary comma's in. How can I get around this problem? Quote Link to comment Share on other sites More sharing options...
bluesoul Posted January 1, 2009 Share Posted January 1, 2009 $address = $address1; if(isset($address2)) { $address .= ", ".$address2; } //etc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.