How to check if two strings contain the same letters?
问题 $textone = "pate"; //$_GET $texttwo = "tape"; $texttre = "tapp"; if ($textone ??? $texttwo) { echo "The two strings contain the same letters"; } if ($textone ??? $texttre) { echo "The two strings NOT contain the same letters"; } What if statement am I looking for? 回答1: I suppose a solution could be to, considering the two following variables : $textone = "pate"; $texttwo = "tape"; 1. First, split the strings, to get two arrays of letters : $arr1 = preg_split('//', $textone, -1, PREG_SPLIT_NO