Q:

check the same value on different arrays or variables

I have 2 variables of equal value:
    $word1 = 'a, b, c, d';
    $word2 = 'b, c, d, a';

I want to check whether the two variables have exactly the same value.  How to check it? 

A:

You could use array_dif() 
Example
<? php

$word1 = 'a, b, c, d';
$word2 = 'b, c, d, a';

$array1 = explode(', ', $word1);
$array2 = explode(', ', $word2);
$result = array_diff($array1, $array2);

print_r($result);

? >

Live example

