Changeset 1449 for trunk/system/helpers/valid.php
- Timestamp:
- 12/07/2007 03:04:05 PM (12 months ago)
- Files:
-
- 1 modified
-
trunk/system/helpers/valid.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/helpers/valid.php
r1446 r1449 153 153 'luhn' => TRUE 154 154 ), 155 'maestro' => array 156 ( 157 'length' => '16,18', 158 'prefix' => '50(?:20|38)|6(?:304|759)', 159 'luhn' => TRUE 160 ), 161 'mastercard' => array 162 ( 163 'length' => '16', 164 'prefix' => '5[1-5]', 165 'luhn' => TRUE 166 ), 155 167 'visa' => array 156 168 ( … … 159 171 'luhn' => TRUE 160 172 ), 161 'maestro' => array 162 ( 163 'length' => '16,18', 164 'prefix' => '50(?:20|38)|6(?:304|759)', 165 'luhn' => TRUE 166 ), 167 'mastercard' => array 173 'visa electron' => array 168 174 ( 169 175 'length' => '16', 170 'prefix' => ' 5[1-5]',176 'prefix' => '4(?:17500|91[37]|508|844)', 171 177 'luhn' => TRUE 172 178 ), … … 225 231 public static function phone($number) 226 232 { 227 $number = preg_replace('/ [^0-9]/', '', $number);233 $number = preg_replace('/\D+/', '', $number); 228 234 229 235 if (strlen($number) > 10 AND substr($number, 0, 1) === '1')
