-1

How can I count total data wrong when compare between array with another array?

example input like this.

$data= array('1','2','5','7');

I want to compare the value with this value in variable $data2 the output of variable $data2 like this :

   Array
(
    [0] => Array
        (
            [kalimat] => 1
        )

    [1] => Array
        (
            [kalimat] => 2
        )

    [2] => Array
        (
            [kalimat] => 5
        )

    [3] => Array
        (
            [kalimat] => 6
        )

    [4] => Array
        (
            [kalimat] => 7
        )
    )

How can I count total wrong data in $data where compare with $data2 ?

Rachmad
  • 149
  • 10

1 Answers1

1

Have you tried the array_diff function?

http://php.net/manual/en/function.array-diff.php