Phone formatted fields in Excel 2003 don't show up properly. They output
something like this: [<=1234567891]1234567891-123456789
I made a fix by passing: format_phone($class_ref->val($row,$col,$sheet))
To this function...
function format_phone($phone) {
$new_phone = preg_replace("/\[<=(\d{10,})\](\d{10,})-(\d{3,})(\d{3})(\d{4})/", "($3) $4-$5", $phone); //Outputs (###) ###-####
if($new_phone == $phone || $new_phone == null) {
return $phone;
}else{
return $new_phone;
}
}
Original issue reported on code.google.com by amer...@volstate.net on 12 Apr 2011 at 11:42
Original issue reported on code.google.com by
amer...@volstate.net
on 12 Apr 2011 at 11:42