Code:
function reSearch($board, $searchValue, $row, $col) {
// find left
if ($row > 0) {
$row1 = $row - 1;
if ($board[$row1][$col] == $searchValue) {
$board[$row1][$col] == "*";
$board = reSearch($board, $searchValue, $row1, $col);
}
}
// find right
if ($row < 9) {
$row1 = $row + 1;
if ($board[$row1][$col] == $searchValue) {
$board[$row1][$col] == "*";
$board = reSearch($board, $searchValue, $row1, $col);
}
}
// find up
if ($col > 0) {
$col1 = $col - 1;
if ($board[$row][$col1] == $searchValue) {
$board[$row][$col1] == "*";
$board = reSearch($board, $searchValue, $row, $col1);
}
}
// find down
if ($col < 9) {
$col1 = $col + 1;
if ($board[$row][$col1] == $searchValue) {
$board[$row][$col1] == "*";
$board = reSearch($board, $searchValue, $row, $col1);
}
}
return $board;
}
sent a position where nothing is next to it in any direction it works,
but when there are any next to the block (making it run the IF statements.. and thus run through it recursively.. it crashes the site..
any text before the call isnt even outputted.. any ideas?