Jump to content



zpupster

Member Since 11 Jul 2010
OFFLINE Last Active Mar 22 2017 10:57
-----

#1725268 formatting the customer_telephone

Posted by zpupster on 25 March 2015 - 19:46

this the function i used in invoice.php

 

<?php
function format_telephone($phone_number)
{
    $cleaned = preg_replace('/[^[:digit:]]/', '', $phone_number);
    preg_match('/(\d{3})(\d{3})(\d{4})/', $cleaned, $matches);
    return "({$matches[1]}) {$matches[2]}-{$matches[3]}";
}
?>

called it here:

<td class="main"><?php echo format_telephone($order->customer['telephone']); ?></td>

this works,

 

but should i put the function in a different area of oscommerce.  




#1704070 Bootstrap 3 in 2.3 new products rows aligning

Posted by zpupster on 19 August 2014 - 13:41

sorry,

 

 

moving on.-- thanks for the bootstrap and all your effort.

 

thanks again,

 

craig