You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
327 B

<?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->isReallyValid()) ? 1 : 0;
}
var_dump($number_of_valid_passports);