Searching if letters in a word are found in another word PHP Strings
<p>Just like the title of this post says, I would to be able to check if every letter of a word is found in another word. So far these are the lines of codes that I was able to come up with:    </p>

<pre><code>&lt;?php   
        $DBword = $_POST['DBword'];
        $inputWords = $_POST['inputWords'];

        $inputCount = str_word_count($inputWords,1);



        echo "&lt;b&gt;THE WORD:&lt;/b&gt;"."&lt;br/&gt;".$DBword."&lt;br/&gt;&lt;br/&gt;";
        echo "&lt;b&gt;WORDS ENTERED:&lt;/b&gt;&lt;br/&gt;";

            foreach($inputCount as $outputWords)
            {
                echo $outputWords."&lt;br/&gt;";
            }

            foreach($inputCount as $countWords)
            {
                for($i=0; $i&lt;strlen($countWords); $i++)
                {$count = strpos( "$DBword", $countWords[$i]);}

                if($count === false)
                {
                    $score++;
                }


            }

            echo "&lt;b&gt;&lt;br/&gt;TOTAL SCORE: &lt;/b&gt;";
            echo $score;


        ?&gt;
</code></pre>

<p>My point in having the <code>foreach</code> with the <code>$outputWords</code> is to just output the letters entered.
As for the other <code>foreach</code> that has <code>$countWords</code>, I am using it to really check if all letters in the word entered are found in the <code>$DBword</code>. I am using the <code>for</code> loop to check every letter.</p>

<p>So far, I am not getting the output that I want and I just ran out of ideas. Any ideas please?</p>
