13 lines
321 B
PHP
13 lines
321 B
PHP
|
<?php
|
||
|
|
||
|
include 'passport.php';
|
||
|
|
||
|
$passports = explode("\n\n", file_get_contents('input.txt'));
|
||
|
$number_of_valid_passports = 0;
|
||
|
|
||
|
foreach ($passports as $passport) {
|
||
|
$passport_o = Passport::fromInput($passport);
|
||
|
$number_of_valid_passports += ($passport_o->isValid()) ? 1 : 0;
|
||
|
}
|
||
|
|
||
|
var_dump($number_of_valid_passports);
|