<?php
for ($i = 0; $i < 10; $i++)
    for ($j = 0; $j < 10; $j++)
        $a[$i][$j] = rand(1, 20);

foreach ($a as $row) {
    foreach ($row as $element) {
        echo ;
        if ($element == 20)
            break 2; 
    }
    echo ;
}
echo ;
?>