I am putting an array ($row) in another array ($allRows):
array_push($allRows, $row);
Is there an easy way to check if an array already exists in $allRows?
Yes:
if (in_array($array1, $array2)) {
echo "Array found";
}
// $array1 - needle.
This is possible with in_arrayDocs:
if (in_array($row, $allRows, TRUE)) {
echo "Array found";
}
In difference to the existing answer, this one actually tells you the order of parameters and that it's necessary that you specify the strict parameter.
Otherwise you would be comparing something else which most likely is not what you're looking for, see Comparison OperatorsDocs.
array_intersect?