How to change the loop to echo the country part and city part in the same li?

the default html output:

<li class=“clearfix”>
<div class=“input-box input-firstname input-select-box”>
<label for=“billing:firstname”>First Name<span class=“required”></span></label>
<input type=“text” value=“” id=“billing:firstname” name=“billing[firstname]” class=“required-entry input-text”>
</div>
<div class=“input-box input-lastname input-select-box”>
<label for=“billing:lastname”>Last Name <span class=“required”>
</span></label>
<input type=“text” value=“” id=“billing:lastname” name=“billing[lastname]” class=“required-entry input-text”>
</div></li>
<li class=“clearfix”>
<div class=“input-box input-country”>…</div></li>

&lt;li class="clearfix"&gt;
        &lt;div class="input-box input-city input-select-box"&gt;
            &lt;label for="billing:city"&gt;City &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
            &lt;input type="text" id="billing:city" class="required-entry input-text" title="City" value="" name="billing[city]"&gt;
        &lt;/div&gt;&lt;/li&gt;

the php code:

$billingFields[‘firstname’] = ’
<div class=“input-box input-firstname’.((in_array(‘firstname’, $formErrors)) ? ’ input-error’ : ‘’).'”>
<label for=“billing:firstname”>‘.$this->(‘First Name’).‘<span class=“required”>*</span></label>
<input class=“required-entry input-text” type=“text” name=“billing[firstname]” id=“billing:firstname” value="’.$this->getFirstname().‘" />
</div>’;
$billingFields[‘lastname’] = ’
<div class=“input-box input-lastname’.((in_array(‘lastname’, $formErrors)) ? ’ input-error’ : ‘’).'”>
<label for=“billing:lastname”>'.$this->
(‘Last Name’).’ <span class=“required”></span></label>
<input class=“required-entry input-text” type=“text” name=“billing[lastname]” id=“billing:lastname” value=“‘.$this->getLastname().’” />
</div>‘;
?>
<?php if(!$this->settings[‘exclude_country_id’]):?>
<?php
$billingFields[‘country_id’] = ’
<div class="input-box input-country’.((in_array(‘country’, $formErrors)) ? ’ input-error’ : ‘’).‘">
<label for=“billing:country_id”>’.$this->__(‘Country’).’ <span class=“required”>
</span></label>
‘.$this->getCountryHtmlSelect(‘billing’).’
</div>‘;
?>
<?php else: ?>
<?php $billingFields[‘country_id’] = ’
<input type=“hidden” name=“billing[country_id]” id=“billing:country_id” value="’.$this->settings[‘default_country’].‘" />’;
?>
<?php endif; ?>
<?php if(!$this->settings[‘exclude_city’]):?>
<?php $billingFields[‘city’] = ’
<div class=“input-box input-city’.((in_array(‘city’, $formErrors)) ? ’ input-error’ : ‘’).'”>
<label for=“billing:city”>‘.$this->(‘City’).’ <span class=“required”>*</span></label>
<input type=“text” name=“billing[city]” value=“‘.$this->htmlEscape($this->getCity()).’” title="'.$this->
(‘City’).’" class=“required-entry input-text” id=“billing:city” />
</div>';
?>
<?php endif; ?>

&lt;?php $billingFields = $this-&gt;getBillingFieldsOrder($billingFields);?&gt;
&lt;?php foreach($billingFields as $key =&gt; $value):?&gt;
    &lt;?php if(!empty($value['has_li'])):?&gt;
        &lt;?php echo implode('',$value['fields']);?&gt;
    &lt;?php else:?&gt;
         
        &lt;li class="clearfix"&gt;&lt;?php echo implode('',$value['fields']);?&gt;
     &lt;?php endif;?&gt;
&lt;?php endforeach;?&gt;

i am sorry . i see the foreach loop. and feel all the code is the same, don’t know how to alter it to output the country and city part in the same li like the firstname and lastname.

<li class=“clearfix”>…</li>