Q:

Php algorithm solution?

In PHP
If you had an array of one million integers, how would you go to print each integer that contain the number seven(eg..7,17,67..) with out using a loop?

A:

Perhaps this'll be it? )
$one_million_number_array = array(1, 1232, 347, 898, 777);
function echo_if_contains_seven($val) {
    if (strpos($val, '7') !== FALSE) { 
        echo $val, "\n"; 
    } 
}

array_walk($one_million_number_array, 'echo_if_contains_seven');

