<?php

$pns = <<< LOL
941-751-6550 ext 2204
(941) 751-6550 ext 2204
(941)751-6550 ext 2204
9417516550 ext 2204
941-751-6550 e 2204
941-751-6550 ext 2204
941-751-6550 extension 2204
941-751-6550 x2204
(941) 751-6550
(941)7516550
941-751-6550
941-751-6550
LOL;

preg_match_all('/^([(\d )\-]+)\s?(?:e.*?|x.*?)?(\d+)?$/sim', $pns, $matches, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($matches[1]); $i++) {
    $phone = preg_replace('#[\-\(\)\s]#','', $matches[1][$i]);
    $extension = preg_replace('#[^0-9]#','', $matches[2][$i]);
    if ($phone == '9417516550' && $extension == '2204') {
             echo "PASS: phone: $phone ext: $extension\n";
    } else {
             echo "FAIL: phone: $phone ext: 0\n";
    }
}