Hi,
It's probably because there is a function and thus the system tries to load it several times and it crashes.
So just do it without a function.
Instead of:
<?php
function localize_us_number($phone) {
$numbers_only = preg_replace("/[^\d]/", "", $phone);
return preg_replace("/^1?(\d{3})(\d{3})(\d{4})$/", "$1-$2-$3", $numbers_only);
}
$address = $this->params->get('address');
echo JText::sprintf('TELEPHONE_IN_ADDRESS',localize_us_number($address->address_telephone)); ?>
do:
<?php
$address = $this->params->get('address');
echo JText::sprintf('TELEPHONE_IN_ADDRESS',preg_replace("/^1?(\d{3})(\d{3})(\d{4})$/", "$1-$2-$3", preg_replace("/[^\d]/", "", $address->address_telephone))); ?>