For Part 2 I logged out the results and manually counted period length that I used to calculate my solution. I guess I could calculate the period programmatically, but I'm just too lazy :)
<?php$file=fopen("input.txt","r")orexit("Unable to open file");while(!feof($file)){$array[]=fgets($file);}fclose($file);returnarray_map(function($str){$str=preg_replace("/\r|\n/","",$str);returnstr_split($str);},array_filter($array));?>
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For Part 2 I logged out the results and manually counted period length that I used to calculate my solution. I guess I could calculate the period programmatically, but I'm just too lazy :)
readFile.php