Basically I want to add the following information to a single database field, (The txt-via-hn textboxes are house numbers, the txt-via are address details)
$vias = $_POST['txt-via-hn2'].' '.$_POST['txt-via2']
.' -> '.$_POST['txt-via-hn3'].' '.$_POST['txt-via3']
.' -> '.$_POST['txt-via-hn4'].' '.$_POST['txt-via4']
.' -> '.$_POST['txt-via-hn5'].' '.$_POST['txt-via5']
.' -> '.$_POST['txt-via-hn6'].' '.$_POST['txt-via6']
.' -> '.$_POST['txt-via-hn7'].' '.$_POST['txt-via7']
.' -> '.$_POST['txt-via-hn8'].' '.$_POST['txt-via8']
.' -> '.$_POST['txt-via-hn9'].' '.$_POST['txt-via9']
.' -> '.$_POST['txt-via-hn10'].' '.$_POST['txt-via10'];
At the moment, for example, if I were to enter two vias the following would be added to the database field:
HOUSENUMBER ADDRESS -> HOUSENUMBER ADDRESS -> -> -> -> -> -> ->
What I want to happen is if the text box value is empty, to not include the empty spaces at the end. So if I was to enter just two vias, only the following would be added:
HOUSENUMBER ADDRESS -> HOUSENUMBER ADDRESS
Is this possible?