Basically i want to take an array of numbers let's say:
Code:
<?
$array1=array("1","2","3","4");
?>
Now say i reprint that same array, but the 3 is missing.
Code:
<?
$array2=array("1","2","4");
?>
How would i print what's missing from $array1 out of $array2?
Sorry if this is confusing, i'll be happy to go into details if needed.
---------- Post added at 02:27 AM ---------- Previous post was at 02:06 AM ----------
Got a fix, i wasn't thinking right today
- asked on another forum and go this as a reply:
Code:
<?php
$arr1 = array(1, 2, 3, 4);
$arr2 = array(1, 2, 4);
$difference = array_diff($arr1, $arr2); // Returns all values from arr1 that are not present in arr2
print_r($difference); // Array(0 => 3)
?>