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? Link to comment https://forums.phpfreaks.com/topic/139078-solved-address-string-issue/ 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 Link to comment https://forums.phpfreaks.com/topic/139078-solved-address-string-issue/#findComment-727423 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.