- array_intersect: documentation ( source)
- array_unique: documentation ( source)
- str_split: documentation ( source)
<?php
$str1 = 'jenny';
$str2 = 'jenny';
$str1chars = array_unique(str_split($str1));
$str2chars = array_unique(str_split($str2));
$matches = array_intersect($str1chars, $str2chars);
if(count($str1chars) === count($matches)){
echo "Bingo!";
}else{
echo "Nope :(";
}