I know I’ve done this before, but I just can’t remember how.
<?php
$address = array();
$address[0]=”123 nearstreet”;
$address[1]=”333 middlestreet”;
$address[2]=”321 farstreet”;
// several addresses
$multi_address = $address[0].” “.$address[1].” “.$address[2];
echo $multi_address;
?>
should output:
123 nearstreet 333 middlestreet 321 farstreet
What I need is to retrieve several addresses from the “address” table into an array and into $multi_address as a single string.
My attempt:
<?php
$multi_address = “
$j = 0;
while($j < $i){ // $i = number of records
echo $address[$j].”|”. ;
$j++;
}
“;
?>
Of course it does not work, but I’m sure you get what I’m attempting.
My goal is to retrieve several addresses into a string and use that string in a google maps api.