I have 2 data in the form of arrays
$x = [ 0,1,1,0,1,0,0,0,0 ];
$y = [ 0,0,1,0,1,0,0,0,0 ];
how to determine the similarity value = 1 if X = Y and similarity value = 0 if X ≠ Y
manual example :
- if 0 is equal to 0 then the result is 1
- if 1 is equal to 1 then the result is 1
- if 0 is equal to 1 then the result is 0
- if 1 is equal to 0 then the result is 0
how to write the program code in the form of an array above ?
please help me.