---
# System prepended metadata

title: undefined

---

# interview

## Q1. 完成下方的身份證驗證函式
[身份證規則](https://web.fg.tp.edu.tw/~anny/idtest.htm?fbclid=IwAR0pI0ymRmanb3sx2noxsfYO1UgzSBVyh3VIM-U3Sl_TaGg6ZrezNT5srwg)
[身份證規則(備用連結)](https://www.laws.taipei.gov.tw/lawatt/Law/A040070051029500-20081126-2000-012.pdf)

```php
function validateTaiwanId(string $id): bool {
    // 
}

$areaMap = ['A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17,'I' => 34, 'J' => 18, 'K' => 19, 'L' => 20, 'M' => 21, 'N' => 22, 'O' => 35, 'P' => 23,'Q' => 24, 'R' => 25, 'S' => 26, 'T' => 27, 'U' => 28, 'V' => 29, 'W' => 32, 'X' => 30,'Y' => 31, 'Z' => 33];


/** test cases
[
    'A123456789', // true
    'A199207076', // true
    'B214633717', // true
    'C173665212', // true
    'C173665213', // false
    'B214533717', // false
    'A175397340', // true
]
**/
```