How to compare two array values in php?
In this tutorial, You can use array_diff() function to compare an array to one or more other arrays.
1. Code:
0) {
return false;
}
return true;
}
$input_array1 = array("Soltuts.com", "tutorials", "tips");
$input_array2 = array("Soltuts.com", "snippets", "tips");
var_dump(compareTwoArray($input_array1, $input_array2));
?>
2. Example:
Input:
$input_array1 = array("Soltuts.com", "tutorials", "tips");
$input_array2 = array("Soltuts.com", "snippets", "tips");
Output:
bool(false)