jasonrogena / jasonrogena/php-excel-reader

Phone formatting not working

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
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 `rob...@teatimevo.com` on 12 Apr 2011 at 11:42

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names the phone formatting path through $class_ref->val($row,$col,$sheet) and the proposed format_phone function, but no file or test. Locate that evaluation path first, reproduce the Excel 2003 output, and verify that phone values such as [<=1234567891]1234567891-123456789 are returned as (###) ###-#### without changing other values.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.