Advent of code 2015/4
Ajax Direct

Answer

Part 1 :
Part 2 :
function get_solution($input, $start)
{
    $i = 0;
    while (true) {
        $i++;
        if (str_starts_with(md5($input . $i), $start)) {
            return $i;
        }
    }
}

$solution_1 = get_solution($input, "00000");
$solution_2 = get_solution($input, "000000");